:root{
      --bg:#0f1115; --panel:#151922; --panel-2:#171b25; --panel-3:#1a1f2b;
      --border:#242a36; --muted:#9aa4b2; --text:#e6e8ec; --text-2:#cfd6df;
      --accent:#4f8cff; --warning:#fbc02d; --success:#6ee7b7; --danger:#ff6b6b;
      /* более спокойный тон для операторских сообщений */
      --bubble-operator:#120a8f; --bubble-bot:#273043; --bubble-client:#222a38;
      --shadow:0 8px 24px rgba(0,0,0,.35); --radius:12px;
      --violet:#8f7cff; --violet-soft:rgba(143,124,255,.18); --violet-light:rgba(143,124,255,.08);
      --motion-fast:140ms; --motion-mid:220ms; --motion-slow:320ms;
      --ease-out:cubic-bezier(0.16,1,0.3,1); --ease-in-out:cubic-bezier(0.4,0,0.2,1);
    }

    html,body{height:100%}
    body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji";overflow:hidden}
    /* Twemoji images align with text */
    img.emoji{height:1em;width:1em;margin:0 .05em;vertical-align:-0.1em}
    *, *::before, *::after { box-sizing:border-box }

    .operator-app{position:relative;display:grid;grid-template-columns:320px minmax(0,1fr) 460px;height:100vh;gap:12px;padding:12px;overflow:hidden}
    .panel{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);display:flex;flex-direction:column;min-height:0;min-width:0}
    .timeline-panel{position:relative;min-width:0}
    .timeline-notify-stack{position:absolute;top:54px;right:14px;display:flex;flex-direction:column;gap:8px;z-index:50;max-width:320px;pointer-events:none}
    .timeline-notify{position:relative;padding:10px 34px 10px 12px;border-radius:12px;background:rgba(18,24,36,.95);border:1px solid rgba(143,124,255,.35);box-shadow:0 12px 24px rgba(0,0,0,.32);backdrop-filter:blur(6px);pointer-events:auto}
    .timeline-notify.is-replacement{border-left:3px solid #8f7cff}
    .timeline-notify.is-cdek{border-left:3px solid #34d399}
    .timeline-notify .title{font-weight:700;color:#eef1ff;font-size:13px;letter-spacing:.02em}
    .timeline-notify .text{margin-top:4px;color:rgba(213,224,247,.85);font-size:12px;line-height:1.4}
    .timeline-notify .meta{margin-top:4px;color:rgba(173,186,220,.7);font-size:11px}
    .timeline-notify .close{position:absolute;top:6px;right:6px;border:none;background:rgba(255,255,255,.08);color:#d6dcf3;width:20px;height:20px;border-radius:6px;cursor:pointer;font-weight:700;line-height:1;display:flex;align-items:center;justify-content:center;transition:background-color var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out)}
    .timeline-notify .close:hover{background:rgba(255,255,255,.16)}
    .timeline-notify .close:active{transform:scale(.95)}
    .toast-stack{position:fixed;top:70px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1200;max-width:340px;pointer-events:none}
    .toast-item{position:relative;padding:10px 34px 10px 12px;border-radius:12px;background:rgba(16,20,30,.96);border:1px solid rgba(143,124,255,.35);border-left:3px solid #8f7cff;box-shadow:0 12px 26px rgba(0,0,0,.35);backdrop-filter:blur(6px);pointer-events:auto;display:flex;flex-direction:column;gap:4px;animation:toast-in .16s var(--ease-out)}
    .toast-title{font-weight:700;color:#eef1ff;font-size:13px;letter-spacing:.02em}
    .toast-body{color:rgba(213,224,247,.85);font-size:12px;line-height:1.4}
    .toast-close{position:absolute;top:6px;right:6px;border:none;background:rgba(255,255,255,.08);color:#d6dcf3;width:20px;height:20px;border-radius:6px;cursor:pointer;font-weight:700;line-height:1;display:flex;align-items:center;justify-content:center;transition:background-color var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out)}
    .toast-close:hover{background:rgba(255,255,255,.16)}
    .toast-close:active{transform:scale(.95)}
    @keyframes toast-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
    .panel-header{padding:12px 14px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:8px;background:linear-gradient(180deg,var(--panel-2),var(--panel))}
    .panel-header.filters-header{align-items:stretch;justify-content:flex-start;padding:14px 14px 12px}
    .filter-toolbar-stack{display:flex;flex-direction:column;align-items:stretch;gap:10px;width:100%}
    .toggle-tabs{display:flex;gap:0;align-items:center;width:100%;max-width:100%;padding:2px;border-radius:14px;background:var(--violet-light);border:1px solid rgba(143,124,255,.22);overflow:hidden}
    .toggle-tabs.toolbar-primary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:6px;border-radius:18px;background:linear-gradient(180deg,rgba(12,18,28,.88),rgba(14,22,34,.72));border:1px solid rgba(130,105,248,.18);box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 10px 26px rgba(5,10,18,.22);overflow:visible}
    .toggle-tabs .toggle{flex:1 1 0;padding:7px 8px;border-radius:12px;background:transparent;border:1px solid transparent;color:var(--text);font-weight:700;letter-spacing:.02em;cursor:pointer;min-width:0;display:flex;align-items:center;justify-content:center;gap:6px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;transition:background-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out)}
    .toggle-tabs.toolbar-primary .toggle{min-height:42px;padding:10px 12px;border-radius:14px;background:rgba(255,255,255,.02);color:rgba(223,231,255,.74);font-size:13px;font-weight:700}
    .toggle-tabs .toggle .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis}
    .toggle-tabs .toggle .tab-count{display:none;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;border:1px solid rgba(251,192,45,.48);background:rgba(251,192,45,.2);color:#ffe29f;font-size:11px;line-height:1;font-weight:700}
    .toggle-tabs.toolbar-primary .toggle .tab-count{min-width:20px;height:20px;padding:0 7px;background:rgba(246,198,87,.18);border-color:rgba(246,198,87,.38);color:#ffdf98;box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
    .toggle-tabs .toggle .tab-count.show{display:inline-flex}
    .toggle-tabs .toggle:active{transform:translateY(1px) scale(.98)}
    .toggle-tabs .toggle.active{background:var(--violet);color:#fff;border-color:transparent;box-shadow:0 6px 14px rgba(130,105,248,.2)}
    .toggle-tabs.toolbar-primary .toggle:hover{color:#f3f6ff;border-color:rgba(130,105,248,.22);background:rgba(255,255,255,.04)}
    .toggle-tabs.toolbar-primary .toggle.active{background:linear-gradient(135deg,rgba(130,105,248,.96),rgba(85,184,255,.92));color:#fff;border-color:rgba(255,255,255,.08);box-shadow:0 12px 24px rgba(77,104,226,.28),inset 0 1px 0 rgba(255,255,255,.18)}
    .toggle-tabs .divider{flex:0 0 auto;width:1px;height:18px;background:rgba(143,124,255,.22);margin:0 2px}
    .toggle-tabs.toolbar-primary .divider{display:none}
    .top-user-controls{position:absolute;top:20px;right:24px;display:flex;align-items:center;gap:10px;padding:0;background:none;border:none;z-index:90}
    .notify-menu{position:absolute;top:36px;right:0;background:rgba(18,24,36,.98);border:1px solid rgba(143,124,255,.35);box-shadow:0 14px 30px rgba(0,0,0,.35);border-radius:12px;padding:10px 12px;min-width:220px;backdrop-filter:blur(6px)}
    .notify-menu-title{font-weight:700;color:#e6ebff;font-size:12px;letter-spacing:.02em;margin-bottom:6px}
    .notify-menu-section{margin-top:8px;margin-bottom:4px;font-size:11px;color:rgba(180,196,230,.75);text-transform:uppercase;letter-spacing:.08em}
    .notify-row{display:flex;align-items:center;gap:8px;font-size:12px;color:#dbe4ff;padding:4px 0;cursor:pointer}
    .notify-row input{accent-color:#8f7cff}
    .top-user-controls.hidden{display:none}
    .top-user-controls .user-name{font-size:13px;color:rgba(207,216,236,.86)}
    .service-health-banner{position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:110;display:flex;align-items:center;gap:10px;max-width:min(720px,calc(100vw - 360px));padding:8px 12px;border-radius:12px;background:rgba(36,18,24,.96);border:1px solid rgba(248,113,113,.5);box-shadow:0 12px 30px rgba(0,0,0,.36);color:#ffd6d6;font-size:12px;font-weight:700;line-height:1.3;backdrop-filter:blur(8px)}
    .service-health-banner[hidden]{display:none!important}
    .service-health-banner .service-health-title{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;color:#fff}
    .service-health-banner .service-health-title::before{content:"";width:8px;height:8px;border-radius:999px;background:#fb7185;box-shadow:0 0 0 4px rgba(248,113,113,.16)}
    .service-health-banner .service-health-items{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden}
    .service-health-banner .service-health-item{display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:230px;padding:4px 8px;border-radius:999px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.09);color:#ffe3e3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .service-health-banner .service-health-item.warn{background:rgba(251,191,36,.14);border-color:rgba(251,191,36,.28);color:#ffe8a3}
    .service-health-banner .service-health-name{color:#fff}
    .service-health-banner .service-health-detail{min-width:0;overflow:hidden;text-overflow:ellipsis;color:inherit;font-weight:600;opacity:.92}
    @media (max-width: 1180px){.service-health-banner{left:12px;right:12px;transform:none;max-width:none;top:62px;flex-wrap:wrap}.service-health-banner .service-health-items{flex-wrap:wrap;overflow:visible}.service-health-banner .service-health-item{max-width:100%}}
    .right-panel-footer{gap:10px}
    .style-toggle{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:10px;border:1px solid rgba(143,124,255,.35);background:rgba(18,24,36,.6);color:#dbe7ff;font-weight:600;letter-spacing:.02em}
    .style-toggle:hover{border-color:rgba(143,124,255,.6);color:#f2f6ff}
    .btn-logout{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:10px;background:transparent;border:2px solid #ff4d4f;color:#ff6b6b;font-weight:600;letter-spacing:.03em;box-shadow:0 0 12px rgba(255,77,79,.35),0 0 0 2px rgba(255,77,79,.18)}
    .btn-logout:hover{background:rgba(255,86,86,.12);border-color:#ff6b6b;color:#ff9f9f;box-shadow:0 0 16px rgba(255,107,107,.4),0 0 0 2px rgba(255,107,107,.24)}
    .panel-title{font-weight:600}
    .scroll{overflow-y:auto;overflow-x:hidden;padding:12px; overflow-anchor:none; contain: layout paint; scrollbar-gutter: stable}
    .input,.select,.btn{background:#1c2230;border:1px solid var(--border);color:var(--text);border-radius:8px;padding:6px 10px;transition:border-color var(--motion-fast) var(--ease-out),box-shadow var(--motion-fast) var(--ease-out),background-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out)}
    .input:focus,.select:focus,textarea:focus{outline:none;border-color:rgba(143,124,255,.55);box-shadow:0 0 0 2px rgba(143,124,255,.2)}
    .btn{cursor:pointer;transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),background-color var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out)}
    .btn:active{transform:translateY(1px) scale(.98)}
    .btn.active{background:var(--accent);color:#fff;box-shadow:0 8px 18px rgba(79,140,255,.25)}
    .btn-primary{background:var(--accent);color:#fff;border:none}
    .chips{display:flex;gap:8px;flex-wrap:wrap;padding:5px;border-radius:16px;background:linear-gradient(180deg,rgba(10,16,24,.62),rgba(13,20,30,.44));border:1px solid rgba(130,105,248,.12);align-self:stretch;width:100%;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}
    .toolbar-strip{position:relative}
    .toolbar-strip-subtle{background:linear-gradient(180deg,rgba(11,17,26,.52),rgba(12,19,29,.36))}
    .toolbar-strip-filters{background:linear-gradient(180deg,rgba(9,14,22,.72),rgba(12,18,28,.52))}
    #folderChips .chip{display:inline-flex;align-items:center;gap:8px;justify-content:center}
    .ozon-tabs{margin-top:0}
    .ozon-tabs .chip{flex:1 1 0;justify-content:center;text-align:center;display:inline-flex;align-items:center;gap:8px}
    .ozon-tabs .chip-count{display:none;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;border:1px solid rgba(251,192,45,.32);background:rgba(251,192,45,.14);color:#ffe29f;font-size:11px;line-height:1;font-weight:700}
    .ozon-tabs .chip-count.show{display:inline-flex}
    #folderChips .chip-count{display:none;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;border:1px solid rgba(96,165,250,.28);background:rgba(96,165,250,.14);color:#d4e7ff;font-size:11px;line-height:1;font-weight:700}
    #folderChips .chip-count.show{display:inline-flex}
    .chips.arch-wide .chip-arch{margin-left:auto}
    .chips.chats-grid,
    .chips.pc-grid{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px;align-items:center}
    .chips.chats-grid .chip,
    .chips.pc-grid .chip{justify-self:auto;text-align:center;width:auto}
    .chips.chats-grid .chip-arch,
    .chips.pc-grid .chip-arch{grid-column:auto;margin-left:auto;width:auto}
    .chips.pc-grid .chip[data-folder="inproc"]{grid-column:auto}
    .chips.ozon-wide .chip{flex:1 1 120px;justify-content:center;text-align:center}
    .chips.ozon-wide .chip-arch{flex:0 0 auto;width:auto}
    .category-switch-anim{animation:categorySwitchFade 160ms ease}
    @keyframes categorySwitchFade{
      from{opacity:.6;transform:translateY(-2px)}
      to{opacity:1;transform:translateY(0)}
    }
    .chip{position:relative;padding:8px 14px;border:1px solid rgba(143,124,255,.16);border-radius:12px;background:rgba(18,28,42,.58);cursor:pointer;color:rgba(223,231,255,.8);font-weight:700;letter-spacing:.01em;transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),border-color var(--motion-fast) var(--ease-out),background-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out);backdrop-filter:blur(8px)}
    .chip::before{content:"";width:6px;height:6px;border-radius:999px;background:var(--chip-accent, rgba(255,255,255,.45));box-shadow:0 0 0 4px color-mix(in srgb, var(--chip-accent, rgba(255,255,255,.45)) 18%, transparent);flex:0 0 auto}
    .chip:hover{background:rgba(24,36,54,.74);border-color:rgba(130,105,248,.24);color:#edf2ff;box-shadow:0 8px 18px rgba(7,14,24,.18)}
    .chip:active{transform:translateY(1px) scale(.98)}
    .chip-arch{margin-left:auto;align-self:flex-start}
    .chip.active{background:linear-gradient(135deg,rgba(130,105,248,.28),rgba(79,140,255,.2));border-color:rgba(130,105,248,.34);color:#fff;box-shadow:0 12px 22px rgba(77,104,226,.2),inset 0 1px 0 rgba(255,255,255,.12)}
    .chip.active::before{box-shadow:0 0 0 5px color-mix(in srgb, var(--chip-accent, rgba(255,255,255,.45)) 24%, transparent)}
    #folderChips .chip[data-folder="all"]{--chip-accent:rgba(203,213,225,.92)}
    #folderChips .chip[data-folder="waiting"]{--chip-accent:#f6c657}
    #folderChips .chip[data-folder="inproc"]{--chip-accent:#34d399}
    #folderChips .chip[data-folder="tech"]{--chip-accent:#8f7cff}
    #folderChips .chip[data-folder="arch"]{--chip-accent:#fb7185}
    .ozon-tabs .chip[data-ozon-tab="all"]{--chip-accent:rgba(203,213,225,.92)}
    .ozon-tabs .chip[data-ozon-tab="chats"]{--chip-accent:#60a5fa}
    .ozon-tabs .chip[data-ozon-tab="questions"]{--chip-accent:#f6c657}
    .ozon-tabs .chip[data-ozon-tab="reviews"]{--chip-accent:#fb7185}
    .ozon-tabs .chip.active{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.08);box-shadow:0 10px 18px rgba(6,12,22,.18),inset 0 0 0 1px rgba(130,105,248,.16)}
    .chip-label{min-width:0}
    @media (max-width: 900px){
      .toggle-tabs.toolbar-primary .toggle{min-height:40px;font-size:12px;padding:9px 10px}
      .chips.ozon-wide .chip{flex:1 1 calc(50% - 4px)}
      .chip{padding:8px 12px}
    }
    @media (max-width: 640px){
      .panel-header.filters-header{padding:12px 12px 10px}
      .filter-toolbar-stack{gap:8px}
      .toggle-tabs.toolbar-primary{padding:5px;gap:5px}
      .toggle-tabs.toolbar-primary .toggle{min-height:38px;padding:8px 8px}
      .chip{font-size:12px}
      .chips.arch-wide .chip-arch,
      .chips.chats-grid .chip-arch,
      .chips.pc-grid .chip-arch{margin-left:0}
    }
    /* Group headers for replacements list */
    .group-header{margin:10px 0 4px;padding:8px 12px;border-radius:12px;background:rgba(143,124,255,.08);border:1px solid rgba(143,124,255,.18);color:#e6e8ec;font-weight:700;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),background-color var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .group-header:hover{background:rgba(143,124,255,.12);box-shadow:0 12px 20px rgba(0,0,0,.28);transform:translateY(-1px)}
    .group-header .gh-title{font-weight:700}
    .group-header .gh-arrow{opacity:.8;transition:transform .18s ease}
    .group-header.collapsed .gh-arrow{transform:rotate(-90deg)}
    .group-body{display:block;margin-bottom:6px;overflow:hidden;max-height:1200px;opacity:1;transform:translateY(0);transition:max-height var(--motion-slow) var(--ease-in-out),opacity var(--motion-mid) var(--ease-out),transform var(--motion-mid) var(--ease-out),margin-bottom var(--motion-fast) var(--ease-out)}
    .group-body.collapsed{max-height:0;opacity:0;transform:translateY(-6px);pointer-events:none;margin-bottom:0}
    
    .client-item{position:relative;background:var(--panel-2);border:1px solid var(--border);border-radius:10px;padding:2px 12px 6px 16px;margin-bottom:8px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px;align-items:start;cursor:pointer;text-align:left;overflow:hidden;transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),border-color var(--motion-fast) var(--ease-out),background-color var(--motion-fast) var(--ease-out)}
    .client-item:hover{background:#1d2332;transform:translateY(-1px);box-shadow:0 12px 22px rgba(0,0,0,.28)}
    .client-item.active{border-color:rgba(110,231,183,.9);box-shadow:0 0 0 2px rgba(110,231,183,.4) inset,0 16px 30px rgba(6,10,22,.35);background:#1b2232}
    .client-item.active:hover{transform:none}
    .client-item.dragging{opacity:.65;transform:none}
    .client-item.drag-over{border-color:rgba(143,124,255,.8);box-shadow:0 0 0 2px rgba(143,124,255,.3) inset}
    .client-item::before{content:"";position:absolute;left:-1px;top:-1px;bottom:-1px;width:6px;border-radius:10px 0 0 10px;background:transparent;opacity:0;transition:background .2s ease,opacity .2s ease}
    .client-item.sla-green::before{background:#22c55e;opacity:1}
    .client-item.sla-yellow::before{background:#f59e0b;opacity:1}
    .client-item.sla-red::before{background:#ef4444;opacity:1}
    .client-item[data-st="processed"]::before{background:transparent!important;opacity:0!important}
    .client-item.tech-chat::before{background:transparent!important;opacity:0!important}
    .client-item[data-ignore="1"]::before{background:transparent!important;opacity:0!important}
    .client-item.tech-chat{min-height:0;padding:2px 8px 2px 10px}
    .client-item.tech-chat .client-name{gap:6px}
    .client-item.tech-chat .client-name-row{gap:6px}
    .client-item.tech-chat .client-name-row [data-role="title"]{font-size:12px}
    .client-item.tech-chat .client-username{display:none}
    .client-item.tech-chat .client-tags{display:none}
    .client-item.tech-chat .last-line{display:none}
    .client-item.tech-chat .client-name .avatar{width:28px;height:28px;border-radius:6px}
    .client-item.tech-chat .client-status-col{
      display:flex!important;
      visibility:visible;
      flex-direction:column;
      align-items:flex-end;
      gap:4px;
      margin-top:0;
      max-width:140px;
    }
    .client-item.tech-chat .client-status-col .badge{font-size:10px;padding:2px 6px}
    .client-item.pc-no-reply-attention{
      --pc-no-reply-shadow: rgba(251,192,45,.32);
      border-color: rgba(251,192,45,.9)!important;
      background: linear-gradient(155deg, rgba(66,44,12,.44), rgba(42,28,12,.5))!important;
      box-shadow: 0 0 0 1px rgba(251,192,45,.45), 0 16px 28px rgba(50,32,10,.38);
      animation: pcNoReplyAttention 2.1s ease-in-out infinite;
    }
    .client-item.pc-no-reply-attention::before{
      background: linear-gradient(180deg, rgba(251,192,45,.85), rgba(255,224,120,.65));
      opacity: 1;
    }
    .client-name{font-weight:600;color:var(--text);display:flex;align-items:center;gap:10px;min-width:0}
    .client-name .avatar{width:40px;height:40px;border-radius:8px;object-fit:cover;background:#0c1220;border:1px solid rgba(255,255,255,.08);flex:0 0 auto}
    .client-name-text{display:flex;flex-direction:column;gap:2px;min-width:0}
    .client-name-row{display:flex;align-items:center;gap:8px;min-width:0}
    .client-name-row [data-role="title"]{display:block;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .client-name-row [data-role="source"]{flex:0 0 auto;white-space:nowrap}
    .client-username{color:var(--muted);font-size:12px;line-height:1.2;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .client-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px;min-width:0}
    .client-tags .badge{font-size:10px;padding:2px 8px}
    .client-tags .badge.no-reply{display:inline-flex;align-items:center;white-space:nowrap;flex:0 0 auto}
    .client-item .last-line{grid-column:1 / -1;display:block;min-width:0;max-width:100%;min-height:15px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .client-item .last-line.client-typing-preview{color:#9ee7ff;font-weight:700}
    .client-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
    .client-meta-top{display:flex;align-items:center;gap:8px;white-space:nowrap;margin-top:8px}
    .client-meta-bottom{display:flex;justify-content:flex-end;margin-top:8px}
    .client-meta-bottom .badge{white-space:nowrap}
    .client-status-col{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:6px;margin-top:6px;grid-column:2;min-width:0;max-width:150px;flex-wrap:wrap;row-gap:4px}
    .client-status-col .badge{display:inline-block;white-space:nowrap;flex:0 0 auto;max-width:100%;overflow:hidden;text-overflow:ellipsis}
    .badge.tag{font-size:10px;padding:2px 8px;border-radius:999px;letter-spacing:.02em}
    .source{color:var(--muted);font-size:12px}
    .badge{padding:2px 10px;border-radius:999px;font-size:12px;border:1px solid transparent;background:#1f2738;color:var(--muted);font-weight:600;letter-spacing:.1px;transition:background-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .badge.waiting{background:rgba(251,192,45,.18);color:#fbc02d;border-color:rgba(251,192,45,.45)}
    .badge.inproc{background:rgba(14,159,110,.18);color:#6ee7b7;border-color:rgba(14,159,110,.5)}
    .badge.processed{background:rgba(239,68,68,.18);color:#ff6b6b;border-color:rgba(239,68,68,.45)}
    /* enforce red for completed in client list even if other styles compete */
    .client-item .badge.processed{background:rgba(239,68,68,.22)!important;color:#ff6b6b!important;border-color:rgba(239,68,68,.55)!important}
    .badge.unread{box-shadow:0 0 0 1px rgba(242,177,255,.45) inset}
    .badge.unread-count{background:rgba(251,192,45,.2);color:#ffd76d;border-color:rgba(251,192,45,.5);font-weight:700}
    .badge.badge-time{background:rgba(0,0,0,.65);color:#e9eefb;border-color:rgba(0,0,0,.7);font-weight:600;font-size:11px}
    .badge.badge-rating{background:rgba(251,191,36,.18);color:#ffe08a;border-color:rgba(251,191,36,.35);font-weight:700;font-size:11px}
    .badge.badge-changed{background:rgba(248,113,113,.18);color:#ffb3b3;border-color:rgba(248,113,113,.4);font-weight:700;font-size:11px}
    .badge.badge-note{background:rgba(148,163,184,.18);color:#dbe7ff;border-color:rgba(148,163,184,.35);font-weight:700;font-size:11px}
    .badge.cdek{background:rgba(143,124,255,.18);color:#cfc9ff;border-color:rgba(143,124,255,.45)}
    .badge.template{background:rgba(143,124,255,.18);color:#d6ceff;border-color:rgba(143,124,255,.45)}
    .badge.ignore{background:rgba(239,68,68,.16);color:#ff9aa6;border-color:rgba(239,68,68,.45)}
    .badge.no-reply{background:rgba(251,192,45,.16);color:#ffe29f;border-color:rgba(251,192,45,.42)}
    .badge.pc-purchase{background:rgba(59,130,246,.16);color:#a9d4ff;border-color:rgba(59,130,246,.42)}
    .badge.tech{background:rgba(59,130,246,.18);color:#9fd2ff;border-color:rgba(59,130,246,.45)}

    .chat-pane{position:relative;display:flex;flex-direction:column;min-height:0}
    .chat-body{position:relative;flex:1;display:flex;flex-direction:column;min-height:0;padding-top:0;min-width:0}
    .chat-split{display:flex;flex:1;min-height:0;min-width:0}
    .chat-topics{width:260px;flex:0 0 260px;background:rgba(12,18,32,.92);border-right:1px solid rgba(90,120,180,.22);display:flex;flex-direction:column;min-height:0}
    .chat-topics-head{padding:10px 12px;font-weight:700;color:#e6ebff;display:flex;align-items:center;justify-content:space-between}
    .chat-topics-search{padding:0 12px 10px}
    .chat-topics-search input{width:100%}
    .chat-topics-list{flex:1;overflow:auto;padding:0 8px 8px;display:flex;flex-direction:column;gap:6px}
    .topic-item{background:#151c2b;border:1px solid rgba(90,120,180,.25);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:4px;cursor:pointer;transition:background .15s ease,border-color .15s ease,transform .15s ease}
    .topic-item:hover{background:#1b2334;border-color:rgba(120,150,220,.45);transform:translateY(-1px)}
    .topic-item.active{border-color:rgba(110,231,183,.8);box-shadow:0 0 0 2px rgba(110,231,183,.35) inset}
    .topic-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
    .topic-title{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:#e9eefb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .topic-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .topic-icon{width:16px;height:16px;border-radius:4px;flex:0 0 auto;object-fit:contain}
    .topic-badge-icon{width:14px;height:14px;margin-right:4px;border-radius:4px}
    .topic-time{font-size:11px;color:rgba(170,186,220,.75);white-space:nowrap}
    .topic-preview{font-size:12px;color:rgba(190,204,232,.78);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .topic-badges{display:flex;align-items:center;gap:6px}
    .topic-unread{background:rgba(251,192,45,.2);color:#ffd76d;border:1px solid rgba(251,192,45,.5);padding:1px 6px;border-radius:999px;font-size:11px;font-weight:700}
    .chat-main{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;--attach-preview-offset:0px}
    .chat-search-fab{position:absolute;top:20px;right:22px;width:38px;height:38px;border-radius:12px;background:rgba(26,36,56,.85);border:1px solid rgba(94,140,255,.35);box-shadow:0 10px 24px rgba(10,16,30,.32);display:flex;align-items:center;justify-content:center;color:#dbe7ff;cursor:pointer;transition:background .2s ease,box-shadow .2s ease,transform .2s ease;z-index:5}
    .chat-search-fab svg{width:20px;height:20px}
    .chat-search-fab:hover{background:rgba(46,76,126,.9);box-shadow:0 14px 28px rgba(20,34,66,.38);transform:translateY(-1px)}
    .chat-search-fab:active{transform:translateY(0)}
    .chat-search-fab:disabled{opacity:.5;cursor:default;box-shadow:none;transform:none}
    .chat-select-fab{position:absolute;top:118px;right:22px;width:38px;height:38px;border-radius:12px;background:rgba(26,36,56,.85);border:1px solid rgba(94,140,255,.35);box-shadow:0 10px 24px rgba(10,16,30,.32);display:flex;align-items:center;justify-content:center;color:#dbe7ff;cursor:pointer;transition:background .2s ease,box-shadow .2s ease,transform .2s ease;z-index:5}
    .chat-select-fab svg{width:20px;height:20px}
    .chat-select-fab:hover{background:rgba(46,76,126,.9);box-shadow:0 14px 28px rgba(20,34,66,.38);transform:translateY(-1px)}
    .chat-select-fab.active{border-color:rgba(34,197,94,.55);background:rgba(22,34,28,.9)}
    .chat-body.search-open .chat-search-fab{transform:translateY(96px)}
    /* Scroll-to-bottom floating button */
    .scroll-bottom-fab{position:absolute;right:22px;bottom:calc(92px + var(--attach-preview-offset, 0px));width:40px;height:40px;border-radius:12px;background:rgba(26,36,56,.88);border:1px solid rgba(94,140,255,.35);box-shadow:0 12px 26px rgba(8,12,24,.38);display:flex;align-items:center;justify-content:center;color:#dbe7ff;cursor:pointer;transition:opacity .2s ease, transform .2s ease, box-shadow .2s ease;opacity:0;transform:translateY(12px);z-index:6}
    .scroll-bottom-fab.visible{opacity:1;transform:none}
    .scroll-bottom-fab.to-new{border-color:rgba(251,192,45,.55);background:rgba(46,38,14,.9);color:#ffe49b}
    .scroll-bottom-fab:hover{background:rgba(40,56,86,.92);box-shadow:0 16px 32px rgba(10,16,30,.42)}
    .scroll-bottom-fab.to-new:hover{background:rgba(62,50,18,.92)}
    .chat-header{position:relative;padding:8px 12px 10px;display:flex;flex-direction:column;gap:8px;align-items:stretch}
    .chat-header.chat-header-preload{overflow:hidden;pointer-events:none}
    .chat-header.chat-header-preload .chat-badges > :not(#chatBadgePhone){visibility:hidden}
    .chat-header.chat-header-preload .chat-header-actions,
    .chat-header.chat-header-preload .pc-header-toggle-wrap{visibility:hidden}
    /* Убираем внутреннюю разделительную полоску у шапки чата */
    .chat-header::after{content:none;display:none;height:0;background:none;box-shadow:none}
    /* И основной нижний бордер панели для шапки чата тоже отключаем и выравниваем фон */
    .panel-header.chat-header{border-bottom:none;background:var(--panel-2)}
    .chat-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
    .chat-info{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;flex:1 1 auto;min-width:0}
    .chat-bottom{display:flex;align-items:center;justify-content:flex-start}
    .chat-badges{display:flex;align-items:flex-start;align-content:flex-start;gap:6px;flex-wrap:wrap;min-width:0;max-width:100%}
    .chat-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;min-height:22px;border-radius:10px;background:linear-gradient(135deg,rgba(29,42,66,.9),rgba(17,29,51,.86));border:1px solid rgba(115,142,196,.3);color:#e6ebff;font-size:11px;font-weight:600;letter-spacing:.01em;box-shadow:none;min-width:0;max-width:100%}
    body:not(.ozon-questions-mode) #chatBadges{min-height:0;overflow:visible}
    #chatBadgeConfig{max-width:100%;overflow:visible;text-overflow:clip;white-space:normal;line-height:1.25;flex:0 1 auto;width:fit-content;overflow-wrap:anywhere;align-self:flex-start}
    .chat-badge.badge-ghost{visibility:hidden;pointer-events:none}
    body.ozon-questions-mode #chatBadges{min-height:48px}
    body.ozon-questions-mode #chatBadges{display:grid;grid-template-columns:auto 1fr;row-gap:6px;column-gap:8px;align-items:start}
    body.ozon-questions-mode #chatBadgePhone{grid-column:1;grid-row:1;justify-self:start}
    body.ozon-questions-mode #chatBadgeConfig{grid-column:2;grid-row:1;max-height:40px;overflow:hidden;line-height:1.25}
    body.ozon-questions-mode #chatBadgeQuestionTime{grid-column:1 / -1;grid-row:2;justify-self:start}
    .chat-badge.clickable{cursor:pointer;border-color:rgba(143,124,255,.45);box-shadow:0 0 0 1px rgba(143,124,255,.18) inset}
    .chat-badge.clickable:hover{background:linear-gradient(135deg,rgba(130,105,248,.28),rgba(98,82,210,.24));color:#eae6ff}
    .chat-badge.pc-truncated{cursor:pointer;border-color:rgba(80,190,180,.45);box-shadow:0 0 0 1px rgba(80,190,180,.16) inset}
    .chat-badge.pc-truncated::after{content:"ещё";display:inline-flex;align-items:center;margin-left:2px;padding:1px 5px;border-radius:7px;background:rgba(80,190,180,.16);color:#a9fff5;font-size:10px;font-weight:700;line-height:1}
    .chat-badge.pc-truncated:hover{background:linear-gradient(135deg,rgba(34,95,104,.45),rgba(21,58,76,.42));color:#eefcff}
    .chat-badge-primary{background:linear-gradient(135deg,rgba(98,176,255,.88),rgba(62,206,205,.85));border-color:rgba(120,200,255,.36);color:#031c2a;padding-left:12px;padding-right:12px}
    .chat-badge-warning{background:linear-gradient(135deg,rgba(251,192,45,.24),rgba(191,126,22,.24));border-color:rgba(251,192,45,.42);color:#ffe29f}
    .chat-typing-indicator{gap:7px;background:linear-gradient(135deg,rgba(79,140,255,.2),rgba(62,206,205,.16));border-color:rgba(126,188,255,.34);color:#cfe8ff}
    .chat-typing-label{white-space:nowrap}
    .chat-typing-dots{display:inline-flex;align-items:center;gap:3px;flex:0 0 auto}
    .chat-typing-dots .dot{width:5px;height:5px;border-radius:50%;background:currentColor;animation:typingBlink 1.2s infinite ease-in-out}
    .chat-typing-dots .dot:nth-child(2){animation-delay:.15s}
    .chat-typing-dots .dot:nth-child(3){animation-delay:.3s}
    .chat-badge[hidden]{display:none !important}
    .pc-header-popover{position:fixed;z-index:120;display:none;width:max-content;max-width:min(520px,calc(100vw - 24px));max-height:min(420px,60vh);overflow:auto;padding:12px 14px;border-radius:12px;background:rgba(17,25,42,.98);border:1px solid rgba(125,170,210,.32);box-shadow:0 18px 46px rgba(4,10,24,.46);color:#e8efff}
    .pc-header-popover.open{display:block}
    .pc-header-popover-title{margin-bottom:6px;color:#aeece7;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
    .pc-header-popover-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.42}
    .chat-header-actions{display:flex;flex-direction:column;align-items:flex-end;gap:6px;padding:0;border-radius:0;background:transparent;border:none;box-shadow:none;flex:0 0 auto;align-self:flex-start}
    .chat-actions-row{display:flex;align-items:center;gap:8px;justify-content:flex-end;flex-wrap:wrap}
    .icon-btn{display:flex;flex-direction:row;align-items:center;gap:6px;background:rgba(26,36,56,.7);border:1px solid rgba(79,140,255,.22);color:#dce6ff;padding:6px 8px;border-radius:10px;min-width:0;cursor:pointer;transition:background .2s ease,border-color .2s ease,transform .2s ease}
    .icon-btn .icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:inherit}
    .icon-btn .icon svg{width:18px;height:18px}
    .icon-btn .label{font-size:10px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
    .icon-btn:hover{background:rgba(60,90,140,.22);border-color:rgba(79,140,255,.45);transform:translateY(-1px)}
    .icon-btn:disabled{opacity:.55;cursor:default;transform:none;box-shadow:none}
    .icon-btn-muted{background:rgba(32,40,58,.6);border:1px dashed rgba(132,144,180,.35);color:rgba(186,196,216,.82)}
    .icon-btn-muted:hover{background:rgba(40,48,66,.7);border-color:rgba(160,170,198,.45);box-shadow:0 10px 20px rgba(30,36,56,.28);transform:none}
    .action-group{display:inline-flex;align-items:stretch;border-radius:12px;overflow:hidden;background:transparent;border:1px solid rgba(96,130,204,.34);box-shadow:none}
    .action-group-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;min-height:34px;border:none;background:transparent;color:#dce6ff;cursor:pointer;transition:background .18s ease,color .18s ease}
    .action-group-btn+.action-group-btn{border-left:1px solid rgba(99,132,204,.3)}
    .action-group-btn .icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;color:inherit}
    .action-group-btn .icon svg{width:18px;height:18px}
    .action-group-btn .label{font-size:10px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
    .action-group-btn:hover{background:rgba(79,140,255,.18)}
    .action-group-btn:disabled{opacity:.55;cursor:default}
    .action-group-btn:disabled:hover{background:transparent}
    .action-group.is-locked{opacity:.55;filter:saturate(.35)}
    .btn:disabled{opacity:.55;cursor:default;transform:none;filter:saturate(.35)}
    .btn-created:disabled{filter:none;opacity:.9}
    .pc-header-toggle-wrap{position:absolute;right:12px;bottom:8px;z-index:3}
    .chat-statuses{display:flex;justify-content:flex-start}
    .status-tabs{position:relative;display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:10px;background:rgba(17,27,46,.74);border:1px solid rgba(92,128,204,.18);box-shadow:none}
    .status-tab{border:none;background:transparent;color:rgba(196,210,240,.7);font-size:11px;letter-spacing:.04em;text-transform:uppercase;font-weight:600;padding:4px 10px;border-radius:9px;cursor:pointer;transition:color .2s ease,background .2s ease}
    .status-tab:hover{color:#f0f4ff;background:rgba(79,140,255,.08)}
    .status-tab[data-status="waiting"].active{background:rgba(251,192,45,.22);color:#ffd052;box-shadow:0 6px 12px rgba(251,192,45,.25)}
    .status-tab[data-status="in_process"].active{background:rgba(34,197,178,.25);color:#34d399;box-shadow:0 6px 14px rgba(34,197,178,.25)}
    .status-tab[data-status="processed"].active{background:rgba(248,113,113,.24);color:#f87171;box-shadow:0 6px 12px rgba(248,113,113,.25)}
    .status-tab:disabled{cursor:default;opacity:.45}
    .status-tabs.is-locked{opacity:.45;filter:saturate(.35)}
    .status-underline{position:absolute;height:2px;border-radius:99px;background:var(--accent);bottom:-2px;left:0;width:0;opacity:0;transition:transform .25s ease,width .25s ease,background .25s ease,opacity .25s ease}
    .repl-tabs.is-locked{opacity:.45;filter:saturate(.65);pointer-events:none}
    .logistics-status-strip.is-locked{opacity:.5;filter:saturate(.6);pointer-events:none}

    /* Right panel tabs: keep clear from top user controls (logout button) */
    .right-tabs{margin-right:0}

    .chat-window{flex:1;overflow-y:auto;overflow-x:hidden;padding:32px 12px 12px;display:flex;flex-direction:column;gap:6px;min-width:0;overflow-anchor:none}
    #chat.chat-preload{overflow-y:hidden}
    #chat.chat-preload > *{visibility:hidden}
    .row{display:flex;gap:6px;min-width:0}
    .row.client{justify-content:flex-start}
    .row.operator,.row.app,.row.bot,.row.ready{justify-content:flex-end}
    .row.hl{outline:2px solid var(--accent); outline-offset:2px; border-radius:10px}
    .bubble{max-width:68%;padding:8px 10px;border-radius:14px;border:1px solid rgba(79,140,255,.18);white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;box-shadow:0 12px 28px rgba(6,12,24,.32);transition:transform .18s ease, box-shadow .18s ease;min-width:0;position:relative;font-size:13px}
    .bubble.client{background:var(--bubble-client);color:var(--text)}
    .bubble.operator{background:var(--bubble-operator);color:#e7f0ff;box-shadow:none}
    .bubble.app{background:rgba(28,41,79,.96);color:#e7f0ff;box-shadow:none}
    /* чуть мягче рамка вокруг операторских сообщений */
    .row.operator .bubble{border-color:rgba(118,152,255,.12)}
    .row.app .bubble{border-color:rgba(158,182,255,.16)}
    .bubble.bot{background:var(--bubble-bot);color:var(--text-2)}
    .bubble.ready,.bubble.template{background:var(--bubble-bot);color:var(--text-2);box-shadow:0 10px 24px rgba(8,12,24,.28)}
    .bubble-text{display:block;white-space:inherit;word-break:break-word;overflow-wrap:anywhere;min-width:0}
    .bubble-text a{color:#dbe7ff;text-decoration:none;padding:1px 6px;border-radius:8px;transition:background .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease;cursor:pointer;border:1px solid rgba(122,162,255,.55);background:rgba(10,14,22,.62);box-shadow:0 6px 14px rgba(9,12,20,.35)}
    .bubble-text a:hover{background:rgba(16,22,36,.8);border-color:rgba(122,162,255,.8);color:#f2f6ff;box-shadow:0 10px 22px rgba(9,12,20,.45)}
    .bubble .scenario-msg-controls{display:flex;gap:6px;margin-top:10px;justify-content:flex-end}
    .scenario-msg-controls button{border:none;cursor:pointer;padding:4px 8px;border-radius:8px;font-size:11px;font-weight:600;letter-spacing:.03em;transition:background .2s ease, transform .2s ease;display:inline-flex;align-items:center;gap:4px}
    .scenario-msg-controls button span{font-size:13px}
    .scenario-msg-controls button.done{background:rgba(56,189,149,.18);color:#34d399;border:1px solid rgba(16,185,129,.35)}
    .scenario-msg-controls button.done:hover{background:rgba(56,189,149,.28);transform:translateY(-1px)}
    .scenario-msg-controls button.fail{background:rgba(248,113,113,.18);color:#f87171;border:1px solid rgba(248,113,113,.35)}
    .scenario-msg-controls button.fail:hover{background:rgba(248,113,113,.28);transform:translateY(-1px)}
    .scenario-msg-controls button.active{box-shadow:0 0 0 2px rgba(255,255,255,.12) inset}
    .row.scenario-done .bubble{border-color:rgba(34,197,94,.45);box-shadow:none}
    .row.scenario-done .bubble::after{content:"";position:absolute;inset:1px auto 1px 1px;width:10px;background:rgba(34,197,94,.85);border-radius:14px 0 0 14px;pointer-events:none}
    .row.scenario-failed .bubble{border-color:rgba(239,68,68,.45);box-shadow:none}
    .row.scenario-failed .bubble::after{content:"";position:absolute;inset:1px auto 1px 1px;width:10px;background:rgba(239,68,68,.85);border-radius:14px 0 0 14px;pointer-events:none}
    .bubble.deleted{background:#1b1f28;color:#8b93a3; font-style:italic}
    .bubble .deleted-notice{margin-top:8px;padding-top:7px;border-top:1px solid rgba(239,68,68,.28);color:#ff9a9a;font-size:12px;font-weight:700;font-style:normal}
    .bubble-wrap{display:flex;flex-direction:column;gap:4px;max-width:68%;align-items:flex-start;min-width:0}
    .row.operator .bubble-wrap,.row.app .bubble-wrap,.row.bot .bubble-wrap,.row.ready .bubble-wrap{align-items:flex-end}
    .bubble-wrap .bubble{display:inline-block;max-width:100%}
    .bubble-wrap .meta-time{font-size:11px;color:rgba(206,216,240,.78);opacity:.85;margin-top:4px;text-align:right;align-self:flex-end}
    .row.client .bubble-wrap .meta-time{text-align:left;align-self:flex-start}
    .row.ready .bubble-wrap .meta-time{color:rgba(255,198,128,.85)}
    /* Limit chat-only meta hide rule to chat area */
    #chat .meta{display:none}
    /* Compact avatars */
    .row .avatar{width:32px;height:32px;border-radius:12px;font-size:13px}
    .row .avatar.avatar-image{background-size:cover;background-position:center;background-repeat:no-repeat;color:transparent}
    .avatar-box{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:72px;width:72px;flex:0 0 72px}
    .avatar-label{font-size:10px;color:rgba(190,205,235,.66);line-height:1;max-width:72px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .bubble.bubble-media{padding:4px;white-space:normal;overflow:hidden;width:var(--media-bubble-width, min(430px,100%));max-width:min(430px,100%)}
    .bubble.bubble-media .bubble-text{box-sizing:border-box;width:100%;padding:6px 6px 3px;line-height:1.35;white-space:pre-wrap;overflow-wrap:break-word}
    .bubble.bubble-media .reply-stub{margin:4px 4px 6px}
    .media-thumb{margin-top:6px;border-radius:10px;overflow:hidden;border:1px solid var(--border);background:#0b0e14;width:360px;max-width:100%;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center}
    .media-thumb.media-image{position:relative;margin-top:0;width:100%;max-width:100%;aspect-ratio:auto;border:none;background:transparent;display:flex;align-items:center;justify-content:center;line-height:0}
    .media-thumb.media-image .media-image-bg{display:none}
    .media-thumb.media-image > img{position:relative;z-index:1;display:block;width:100%;height:auto;max-width:100%;max-height:min(62vh, 560px);object-fit:contain;background:transparent;border-radius:8px}
    .media-thumb.media-image.media-portrait{height:min(430px, 64vh);background:rgba(9,13,20,.2)}
    .media-thumb.media-image.media-portrait .media-image-bg{display:block;position:absolute;inset:-18px;background-size:cover;background-position:center;filter:blur(18px);transform:scale(1.06);opacity:.72}
    .media-thumb.media-image.media-portrait::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(15,20,30,.28),rgba(255,255,255,.16) 50%,rgba(15,20,30,.28));z-index:0}
    .media-thumb.media-image.media-portrait > img{width:auto;height:auto;max-width:72%;max-height:100%;box-shadow:0 10px 24px rgba(0,0,0,.18)}
    .media-thumb.media-image.media-square > img{width:100%;max-height:min(430px, 60vh)}
    .media-thumb.media-image.media-landscape > img{width:100%;max-height:min(54vh, 430px)}
    .media-thumb > video, .media-thumb > img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;background:#000}
    .media-thumb>video,.media-thumb>img{width:100%;height:100%;object-fit:contain;background:#000}
    .media-album{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;width:min(430px,100%);max-width:100%;overflow:hidden;border-radius:10px;background:rgba(7,12,22,.72)}
    .media-album-count-3{grid-template-columns:repeat(2,minmax(0,1fr))}
    .media-album-count-3 .media-album-tile:first-child{grid-row:span 2}
    .media-album-tile{position:relative;min-width:0;aspect-ratio:1/1;overflow:hidden;background:#05070c}
    .media-album-tile .media-thumb{width:100%;height:100%;max-width:none;margin:0;border:0;border-radius:0}
    .media-album-tile .media-thumb.media-image{height:100%;background:#05070c}
    .media-album-tile .media-thumb.media-image > img{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;border-radius:0}
    .media-album-tile .media-thumb.media-image.media-portrait,
    .media-album-tile .media-thumb.media-image.media-square,
    .media-album-tile .media-thumb.media-image.media-landscape{height:100%;background:#05070c}
    .media-album-tile .media-thumb.media-image.media-portrait .media-image-bg,
    .media-album-tile .media-thumb.media-image.media-portrait::after{display:none}
    .media-album-tile .media-thumb.media-image.media-portrait > img,
    .media-album-tile .media-thumb.media-image.media-square > img,
    .media-album-tile .media-thumb.media-image.media-landscape > img{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;box-shadow:none}
    .media-album-tile .file-chip,
    .media-album-tile .audio-card{width:100%;height:100%;margin:0;border-radius:0}
    /* Audio and file chips */
    .audio-thumb{margin-top:6px;border-radius:10px;border:1px solid var(--border);background:#0b0e14;padding:8px;width:360px;max-width:100%}
    .audio-thumb audio{width:100%}
    .file-chip{margin-top:6px;display:flex;align-items:center;gap:10px;border:1px solid var(--border);background:#0b0e14;border-radius:12px;padding:10px 12px;max-width:520px;min-width:0}
    .bubble.bubble-media .file-chip{box-sizing:border-box;width:100%;max-width:100%;margin-top:0;background:rgba(7,12,22,.78);border-color:rgba(170,188,230,.18)}
    .file-chip .name{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .file-chip .ico{font-size:18px}
    .file-chip a{color:#8fd9ff;text-decoration:none;font-weight:600;margin-left:auto}
    .audio-card{margin-top:8px;border:1px solid var(--border);background:rgba(17,24,39,.7);border-radius:14px;padding:10px 12px;width:360px;max-width:100%}
    .audio-card .row{display:flex;align-items:center;gap:10px;margin-bottom:6px}
    .audio-card .ico{font-size:18px}
    .audio-card .name{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .audio-card .action{color:#cfe6ff;text-decoration:none;font-weight:700;padding:6px 8px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(143,124,255,.3);background:linear-gradient(180deg,rgba(130,105,248,.22),rgba(98,82,210,.18));box-shadow:0 6px 14px rgba(130,105,248,.15)}
    .audio-card .action:hover{background:linear-gradient(180deg,rgba(130,105,248,.3),rgba(98,82,210,.24))}
    .audio-card .action.dl{min-width:32px;min-height:32px;font-size:16px}
    .audio-card .meta{display:flex;align-items:center;gap:10px;margin-top:6px}
    .audio-card .time{font-weight:600;font-size:12px;color:#e6e8ec;background:rgba(255,255,255,.06);padding:4px 8px;border-radius:8px}
    .audio-card .bar{position:relative;flex:1;height:8px;background:#0a0f18;border-radius:999px;box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
    .audio-card .bar .fill{position:absolute;left:0;top:0;bottom:0;background:#111827;border-radius:999px;width:0%}
    .audio-card .bar .knob{position:absolute;top:50%;transform:translate(-50%,-50%);width:8px;height:8px;border-radius:50%;background:#e6e8ec}
    .audio-card .play{min-width:30px;min-height:30px;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);color:#e6e8ec;display:inline-flex;align-items:center;justify-content:center;font-weight:700}
    .audio-card .play:hover{background:rgba(255,255,255,.1)}
    /* Flat, modern audio card */
    .audio-card{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);box-shadow:none;border-radius:12px}
    .audio-card .ac-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 6px 0}
    .audio-card .file-badge{display:inline-flex;align-items:center;gap:8px;min-width:0;max-width:calc(100% - 36px)}
    .audio-card .ac-ico{font-size:16px;opacity:.9}
    .audio-card .ac-name{color:rgba(230,232,236,.6);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .audio-card .ac-dl{width:28px;height:28px;border-radius:8px;border:1px solid var(--border);background:transparent;color:rgba(230,232,236,.9);display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
    .audio-card .ac-dl:hover{border-color:rgba(207,230,255,.45);color:#cfe6ff}
    .audio-card .ac-player{display:flex;align-items:center;gap:10px;padding:4px 2px 2px}
    .audio-card .ac-play{width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:transparent;color:#e6e8ec;font-weight:700;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
    .audio-card .ac-play:hover{background:rgba(255,255,255,.06)}
    .audio-card .ac-time{font-size:12px;color:rgba(230,232,236,.75)}
    .audio-card .ac-bar{position:relative;flex:1;height:4px;border-radius:999px;background:rgba(255,255,255,.14)}
    .audio-card .ac-fill{position:absolute;left:0;top:0;bottom:0;width:0%;border-radius:inherit;background:linear-gradient(90deg, rgba(79,140,255,.95), rgba(143,124,255,.95))}
    .audio-card.voice-card{--voice-accent:#1da1f2;--voice-bar:rgba(128,145,174,.64);--voice-played:#d2dceb;box-sizing:border-box;width:304px;max-width:100%;min-height:56px;margin-top:6px;padding:8px 10px;border:0;border-radius:10px;background:rgba(38,50,72,.82);box-shadow:inset 0 0 0 1px rgba(255,255,255,.09)}
    .bubble.bubble-media .audio-card.voice-card{width:100%;margin-top:0}
    .audio-card.voice-card .ac-player{display:grid;grid-template-columns:46px minmax(0,1fr) 26px;align-items:center;gap:8px;padding:0}
    .audio-card.voice-card .ac-play{width:44px;height:44px;border:0;border-radius:50%;background:var(--voice-accent);color:#062135;font-size:17px;font-weight:800;line-height:1;box-shadow:none}
    .audio-card.voice-card .ac-play:hover{background:#33acf4}
    .audio-card.voice-card .ac-body{min-width:0;display:flex;flex-direction:column;gap:5px}
    .audio-card.voice-card .ac-waveform{position:relative;display:flex;align-items:center;gap:2px;height:25px;min-width:0;cursor:pointer;touch-action:none;outline:none}
    .audio-card.voice-card .ac-waveform:focus-visible{box-shadow:0 0 0 2px rgba(29,161,242,.45);border-radius:8px}
    .audio-card.voice-card .ac-wavebar{display:block;flex:1 1 0;min-width:2px;max-width:5px;border-radius:999px;background:var(--voice-bar);transition:background .12s ease}
    .audio-card.voice-card .ac-wavebar.is-played{background:var(--voice-played)}
    .audio-card.voice-card .ac-meta{display:flex;align-items:center;min-width:0;color:rgba(230,235,245,.9);font-size:12px;line-height:1.1;white-space:nowrap}
    .audio-card.voice-card .ac-time{font-size:12px;color:inherit}
    .audio-card.voice-card .ac-size{color:inherit;overflow:hidden;text-overflow:ellipsis}
    .audio-card.voice-card .ac-dl{width:26px;height:26px;align-self:start;border:0;background:transparent;color:rgba(230,235,245,.68);font-size:14px;opacity:.72}
    .audio-card.voice-card:hover .ac-dl,.audio-card.voice-card .ac-dl:focus-visible{opacity:1;color:#cfe6ff}
    .row.operator .audio-card.voice-card,.row.app .audio-card.voice-card,.row.bot .audio-card.voice-card{--voice-accent:#24a7e8;--voice-bar:rgba(150,202,230,.44);--voice-played:rgba(255,255,255,.88);background:rgba(36,76,98,.48)}
    .row.client .audio-card.voice-card{--voice-accent:#20a7e8;--voice-bar:rgba(126,142,170,.58);--voice-played:rgba(224,232,244,.92);background:rgba(37,48,70,.86)}
    /* Remove outer bubble chrome for audio-only messages */
    .bubble:has(.audio-card), .bubble.bubble-audio{
      border:none !important;
      box-shadow:none !important;
      background:transparent !important;
      padding:0 !important;
    }
    .bubble:has(.audio-card) .audio-card, .bubble.bubble-audio .audio-card{margin:0}
    .composer{display:flex;gap:8px;padding:12px;border-top:1px solid var(--border);background:var(--panel-2);align-items:center;flex:0 0 auto}
    .composer .input{flex:1;align-self:stretch}
    #attachBtn,#sendBtn{height:32px;min-height:32px;display:flex;align-items:center;justify-content:center;padding:0 12px;white-space:nowrap}
    #attachBtn{min-width:36px;padding:0 8px;font-size:18px;line-height:1}
    #messageInput{min-height:44px;max-height:180px;padding:10px 12px;line-height:1.45;resize:none;overflow-y:auto}
    #messageInput::placeholder{color:rgba(200,208,226,.6)}

    .list-item{padding:10px;border-radius:8px;background:#121621;border:1px solid var(--border);cursor:pointer;margin-bottom:8px}
    .list-item:hover{background:#171c29}
    .list-item .fw-row{display:flex;align-items:center;gap:10px}
    .list-item .fw-avatar{width:32px;height:32px;border-radius:8px;object-fit:cover;background:#0c1220;border:1px solid rgba(255,255,255,.08);flex:0 0 auto}
    .list-item .fw-avatar.fw-emoji{display:flex;align-items:center;justify-content:center;font-size:16px;line-height:1}
    .list-item .fw-avatar.fw-emoji img.emoji{width:18px;height:18px}
    .list-item .fw-avatar .fw-emoji-img{width:18px;height:18px;display:block}
    .list-item .fw-avatar.fw-avatar-empty{background:transparent;border-color:transparent}
    .list-item .fw-row.align-top{align-items:flex-start}
    .list-item .fw-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
    .list-item .fw-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .list-item .fw-status{font-size:12px;color:var(--muted);white-space:nowrap}
    .list-item.ozon-question-item .fw-info,.list-item.ozon-review-item .fw-info{gap:6px}
    .list-item.ozon-question-item .fw-status-row,.list-item.ozon-review-item .fw-status-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;white-space:normal}
    .list-item.ozon-question-item .fw-status-row .badge,.list-item.ozon-review-item .fw-status-row .badge{margin:0}
    .list-item.ozon-question-item .fw-meta,.list-item.ozon-review-item .fw-meta{font-size:11px;color:rgba(200,208,226,.7);white-space:nowrap}

    #problemList{display:flex;flex-direction:column;gap:12px}
    .timeline-toolbar{position:sticky;top:0;z-index:6;display:grid;grid-template-columns:.75fr 1.08fr 1.18fr 1fr .82fr;align-items:center;gap:2px;margin:0 0 12px 0;padding:5px;border:1px solid rgba(130,105,248,.24);border-radius:14px;background:linear-gradient(180deg,rgba(14,21,33,.98),rgba(14,21,33,.92));overflow:hidden;transform:translateY(0);will-change:transform;transition:transform .16s ease}
    .timeline-toolbar.is-scrolled{transform:translateY(-12px)}
    .timeline-filter-indicator{position:absolute;z-index:0;top:6px;left:0;height:calc(100% - 12px);width:0;border-radius:10px;background:linear-gradient(180deg,rgba(130,105,248,.34),rgba(103,86,219,.3));border:1px solid rgba(130,105,248,.55);box-shadow:0 8px 18px rgba(130,105,248,.28);opacity:0;transform:translateX(0);transition:transform .2s ease,width .2s ease,opacity .2s ease}
    .timeline-filter{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:7px 4px;border:0;border-radius:10px;background:transparent;color:var(--text-2);font-size:10px;font-weight:700;cursor:pointer;white-space:nowrap;line-height:1.1;min-width:0;transition:color .16s ease,opacity .16s ease}
    .timeline-filter .ico{font-size:12px;line-height:1}
    .timeline-filter .lbl{min-width:0}
    .timeline-filter:hover{color:#e8eeff}
    .timeline-filter.active{color:#f2f0ff}
    .timeline-forms{display:flex;flex-direction:column;gap:10px;margin:0 0 12px 0}
    .timeline-action-section{margin:0;padding:10px;border:1px solid var(--border);border-radius:12px;background:rgba(15,22,34,.78)}
    .timeline-action-row{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}
    .timeline-action-field{flex:1;min-width:220px}
    .timeline-action-field label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
    .timeline-action-hint{margin-top:8px;font-size:12px;color:var(--muted)}
    .timeline-list{border:1px solid var(--border);border-radius:12px;background:rgba(15,22,34,.78);overflow:hidden}
    .timeline-empty{padding:14px 12px;color:var(--muted);font-size:13px}
    .timeline-day-divider{display:flex;align-items:center;gap:10px;margin:10px 6px;color:rgba(173,186,220,.9);font-size:11px;letter-spacing:.08em;text-transform:uppercase}
    .timeline-day-divider::before,.timeline-day-divider::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,rgba(143,124,255,.1),rgba(143,124,255,.35),rgba(143,124,255,.1))}
    .timeline-day-label{padding:2px 8px;border-radius:999px;border:1px solid rgba(143,124,255,.28);background:rgba(143,124,255,.12);color:#d8e2ff}
    .timeline-title{font-weight:600;color:#e9efff}
    .timeline-meta{font-size:12px;color:rgba(173,186,220,.78)}
    .timeline-text{margin-top:6px;font-size:13px;line-height:1.45;color:#d7deee;white-space:pre-wrap}
    .timeline-pills{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
    .chat-header-center{display:flex;justify-content:center;align-items:center;margin-top:2px}
    .chat-status-marker{display:flex;align-items:center;gap:10px;margin:12px 6px;padding:8px 10px;border-radius:10px;border:1px solid rgba(130,105,248,.45);background:linear-gradient(180deg,rgba(130,105,248,.16),rgba(80,66,170,.14));color:#ebe7ff;font-size:12px;line-height:1.35;box-shadow:0 10px 18px rgba(16,10,35,.22)}
    .chat-status-marker::before,.chat-status-marker::after{content:"";height:1px;flex:1;background:linear-gradient(90deg,rgba(130,105,248,0),rgba(130,105,248,.55),rgba(130,105,248,0))}
    .chat-status-marker .pill{flex:0 0 auto}
    .chat-status-marker .label{font-weight:600}
    .chat-status-marker .time{color:rgba(217,208,255,.8)}
    .chat-status-marker.pulse{animation:messageHighlight 1.2s ease}
    .row.unread-divider{justify-content:center;margin:10px 0 8px;gap:0;pointer-events:none;overflow:hidden;transform-origin:center center;transition:height .18s ease,margin .18s ease,opacity .18s ease}
    .row.unread-divider .unread-divider-label{padding:6px 12px;border-radius:999px;border:1px solid rgba(251,192,45,.45);background:rgba(40,32,12,.72);color:#ffe6a8;font-size:12px;font-weight:700;letter-spacing:.01em;box-shadow:0 8px 18px rgba(32,24,8,.28);transition:transform .18s ease,opacity .18s ease}
    .row.unread-divider.closing{opacity:0}
    .row.unread-divider.closing .unread-divider-label{opacity:0;transform:scale(.96)}
    .problem-card{position:relative;padding:14px 16px;border-radius:14px;background:linear-gradient(180deg,rgba(17,27,41,.88),rgba(14,21,33,.92));border:1px solid transparent;box-shadow:0 14px 28px rgba(6,10,22,.35);cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
    .problem-card:hover{transform:translateY(-2px);box-shadow:0 18px 36px rgba(6,10,22,.42);border-color:rgba(130,105,248,.38)}
    .problem-card.active{border-color:rgba(110,231,183,.55);box-shadow:0 18px 32px rgba(16,185,129,.32)}
    .problem-card .head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:6px}
    .problem-card .name{font-weight:600;color:#e6ebff;letter-spacing:.1px}
    .problem-card .date{font-size:12px;color:rgba(173,186,220,.74)}
    .problem-card .preview{font-size:14px;color:#e5ecff;line-height:1.5;margin-bottom:8px;font-weight:600}
    .problem-card .info{display:flex;align-items:center;gap:18px;font-size:12px;color:rgba(155,170,205,.78)}
    .problem-card .info span{display:flex;align-items:center;gap:6px}
    .problem-card .info .ico{font-size:13px;opacity:.85}

    /* Compact problem details: align title + meta on one row */
    .problem-block{position:relative;margin-top:6px;padding:8px 10px;border-radius:10px;background:rgba(18,28,44,.94);border:none;box-shadow:none;display:grid;grid-template-columns:1fr auto;grid-row-gap:6px;align-items:center;transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .problem-block:hover{transform:translateY(-1px);box-shadow:0 12px 22px rgba(0,0,0,.28)}
    .problem-block .title{font-weight:600;font-size:14px;color:#f0f3ff;grid-column:1;grid-row:1}
    /* переносим дату под заголовок, чтобы вверху справа освободить место для кнопки */
    .problem-block .meta{font-size:11px;color:rgba(173,186,220,.78);grid-column:1;grid-row:2}
    .problem-block .summary{grid-column:1 / span 2;display:flex;flex-wrap:wrap;gap:8px;font-size:12px;color:rgba(173,186,220,.78)}
    /* фиксированное размещение кнопки архива в правом верхнем углу */
    .problem-block .actions-top{position:absolute;top:8px;right:10px;z-index:1}
    .problem-block .btn-archive{padding:6px 12px;border-radius:10px;border:1px solid rgba(130,105,248,.45);background:linear-gradient(180deg,rgba(130,105,248,.28),rgba(98,82,210,.24));color:#eae6ff;font-weight:700;letter-spacing:.02em;cursor:pointer;box-shadow:0 8px 16px rgba(130,105,248,.25)}
    .problem-block .btn-archive:hover{background:linear-gradient(180deg,rgba(130,105,248,.38),rgba(98,82,210,.34))}
    .problem-block .btn-archive.is-locked{border-color:rgba(110,231,183,.55);background:linear-gradient(180deg,rgba(16,185,129,.28),rgba(14,159,110,.24));color:#eafff6;box-shadow:0 8px 16px rgba(16,185,129,.25)}
    .problem-block .btn-archive.is-locked:hover{background:linear-gradient(180deg,rgba(16,185,129,.36),rgba(14,159,110,.30))}
    .problem-block .summary span{display:flex;align-items:center;gap:6px}
    .problem-block .summary .ico{font-size:13px;opacity:.85}
    .problem-block pre{grid-column:1 / span 2;font-size:12px;line-height:1.45;background:rgba(13,20,32,.82);border-radius:8px;padding:8px;white-space:pre-wrap;color:#dce3ff;border:none;box-shadow:inset 0 1px 0 rgba(143,124,255,.18)}
    .problem-block .attachments{grid-column:1 / span 2;display:flex;flex-direction:column;gap:6px;font-size:12px;color:#cdd6f5}
    .problem-block .attachments .item{padding:6px;border-radius:8px;background:rgba(16,24,38,.82);display:flex;justify-content:space-between;align-items:center;border:none;box-shadow:inset 0 1px 0 rgba(130,105,248,.12)}

    /* Problem details collapse/expand animation */
    #problemDetails{overflow:hidden;max-height:0;opacity:0;transform:translateY(-6px);transition:max-height .28s ease, opacity .28s ease, transform .28s ease;}
    #problemDetails.open{max-height:1000px;opacity:1;transform:none}
    .problem-block .attachments .name{max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .problem-block .attachments .item a{color:#8fd9ff;text-decoration:none;font-weight:600}
    .problem-block .attachments .item a:hover{color:#c2f1ff}
    .problem-block .cdek-del{grid-column:2;grid-row:1 / span 2;align-self:center;justify-self:end;padding:6px 10px;border-radius:10px;border:1px solid rgba(255,107,107,.55);background:rgba(255,107,107,.12);color:#ffd4d4;font-size:12px;font-weight:600;cursor:pointer;transition:background .2s ease,border-color .2s ease,transform .2s ease}
    .problem-block .cdek-del:hover{background:rgba(255,107,107,.2);transform:translateY(-1px)}
    .problem-block .cdek-del:disabled{opacity:.6;cursor:default;transform:none}
    .repl-history{grid-column:1 / span 2;margin-top:6px;display:flex;flex-direction:column;gap:8px}
    .repl-history-title{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:rgba(173,186,220,.7)}
    .repl-history-item{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:rgba(200,210,234,.86)}
    .repl-history-pills{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
    .repl-history-meta{font-size:11px;color:rgba(173,186,220,.7)}
    .repl-history-time{font-size:11px;color:rgba(173,186,220,.6);white-space:nowrap;font-variant-numeric:tabular-nums}
    .repl-history-item.is-latest .pill{box-shadow:0 0 0 2px rgba(255,255,255,.12) inset}
    /* highlight replacement card (strong visible ring) */
    .problem-block.hl{outline:2px solid rgba(143,124,255,.85); box-shadow:0 0 0 3px rgba(143,124,255,.28), 0 10px 22px rgba(143,124,255,.25);}

    .notes{margin-top:18px;padding:18px 20px;border-radius:16px;background:rgba(20,30,46,.94);border:none;box-shadow:0 12px 22px rgba(5,10,22,.24);display:flex;flex-direction:column;gap:10px}
    .notes.notes-attention{
      animation: notePulseAttention 1.8s cubic-bezier(.16,1,.3,1) infinite;
      border:1px solid rgba(251,192,45,.75);
      box-shadow:0 14px 28px rgba(251,192,45,.25),0 0 0 1px rgba(251,192,45,.35), 0 0 18px rgba(251,192,45,.22);
      background:linear-gradient(145deg, rgba(35,24,14,.96) 0%, rgba(27,20,9,.95) 38%, rgba(17,26,38,.94) 100%);
    }
    .notes.notes-attention .title{
      color:#ffe3a8;
      text-shadow:0 0 10px rgba(255,227,172,.45);
      animation: noteTitleGlow 1.8s cubic-bezier(.16,1,.3,1) infinite;
    }
    .notes.notes-attention textarea{
      border-color:rgba(251,192,45,.75);
      box-shadow:0 0 0 2px rgba(251,192,45,.25), inset 0 4px 12px rgba(5,10,20,.45);
    }
    .notes .title{font-weight:600;font-size:15px;color:#f0f3ff}
    .notes textarea{width:100%;min-height:160px;resize:vertical;background:rgba(12,20,32,.88);border:1px solid rgba(130,105,248,.18);border-radius:12px;color:#e4ecff;padding:12px 14px;box-shadow:none}
    .notes textarea:focus{outline:none;border-color:rgba(110,231,183,.55);box-shadow:0 0 0 2px rgba(110,231,183,.2), inset 0 4px 12px rgba(5,10,20,.45)}
    .notes .muted{font-size:12px;color:rgba(173,186,220,.7)}

    @keyframes notePulseAttention{
      0%,100%{
        transform:translate3d(0,0,0) rotate(0deg);
        box-shadow:0 14px 28px rgba(251,192,45,.22),0 0 0 1px rgba(251,192,45,.25), 0 0 18px rgba(251,192,45,.15)
      }
      8%{
        transform:translate3d(-2px,0,0) rotate(-0.45deg);
        box-shadow:0 10px 20px rgba(251,192,45,.42),0 0 0 1px rgba(251,192,45,.42), 0 0 26px rgba(251,192,45,.32)
      }
      16%{
        transform:translate3d(2px,0,0) rotate(0.45deg);
        box-shadow:0 16px 28px rgba(251,192,45,.38),0 0 0 1px rgba(251,192,45,.45), 0 0 32px rgba(251,192,45,.34)
      }
      24%{
        transform:translate3d(-1.5px,0,0) rotate(-0.22deg);
        box-shadow:0 12px 24px rgba(251,192,45,.35),0 0 0 1px rgba(251,192,45,.4), 0 0 26px rgba(251,192,45,.25)
      }
      32%{
        transform:translate3d(1.5px,0,0) rotate(0.22deg);
        box-shadow:0 14px 27px rgba(251,192,45,.32),0 0 0 1px rgba(251,192,45,.35), 0 0 20px rgba(251,192,45,.22)
      }
      40%,58%{
        transform:translate3d(0,0,0) rotate(0deg);
        box-shadow:0 14px 28px rgba(251,192,45,.22),0 0 0 1px rgba(251,192,45,.25), 0 0 18px rgba(251,192,45,.15)
      }
    }
    @keyframes noteTitleGlow{
      0%,100%{opacity:1}
      50%{opacity:0.78}
    }
    @media (prefers-reduced-motion: reduce){
      .notes.notes-attention{animation:none}
      .notes.notes-attention .title{animation:none}
    }

    
    /* Collapsible problem groups */
    .problem-group{border:1px solid var(--border);border-radius:10px;background:rgba(12,20,32,.6);box-shadow:0 10px 20px rgba(0,0,0,.18);margin-bottom:10px;overflow:hidden;transition:box-shadow var(--motion-mid) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .problem-group .pg-head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;background:rgba(14,24,38,.85);cursor:pointer;font-weight:600;color:#d7e6ff;transition:background-color var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out)}
    .problem-group .pg-head:hover{background:rgba(20,32,50,.9);transform:translateY(-1px)}
    .problem-group .pg-head .meta{font-size:12px;color:rgba(190,205,235,.8)}
    .problem-group .pg-head .chev{transition:transform .18s ease;opacity:.8}
    .problem-group.collapsed .pg-head .chev{transform:rotate(-90deg)}
    .problem-group .pg-body{padding:10px;display:flex;flex-direction:column;gap:8px;overflow:hidden;max-height:1200px;opacity:1;transform:translateY(0);transition:max-height var(--motion-slow) var(--ease-in-out),opacity var(--motion-mid) var(--ease-out),transform var(--motion-mid) var(--ease-out),padding var(--motion-fast) var(--ease-out)}
    .problem-group.collapsed .pg-body{max-height:0;opacity:0;transform:translateY(-6px);pointer-events:none;padding-top:0;padding-bottom:0}

    /* Таймлайн — базовые элементы */
    .hist{
      position:relative;
      display:grid;
      grid-template-columns:22px minmax(0,1fr) auto;
      column-gap:10px;
      align-items:start;
      padding:10px 12px;
      border-bottom:1px solid var(--border);
      --hist-line-color: rgba(143,124,255,.72);
      --hist-icon-bg: rgba(130,105,248,.2);
    }
    .hist:last-child{border-bottom:none}
    .hist-rail{position:relative;align-self:stretch}
    .hist-rail::before{
      content:'';
      position:absolute;
      left:10px;
      top:-10px;
      bottom:-10px;
      width:2px;
      border-radius:2px;
      background:linear-gradient(180deg,var(--hist-line-color),rgba(255,255,255,.05));
    }
    .hist:first-child .hist-rail::before{top:8px}
    .hist:last-child .hist-rail::before{bottom:8px}
    .hist-icon{
      position:relative;
      z-index:1;
      width:18px;
      height:18px;
      border-radius:999px;
      display:flex;
      align-items:center;
      justify-content:center;
      font-size:11px;
      line-height:1;
      border:1px solid var(--hist-line-color);
      background:var(--hist-icon-bg);
      box-shadow:0 0 0 3px rgba(8,14,24,.82);
      color:var(--hist-line-color);
    }
    .hist-icon svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
    .hist-main{min-width:0}
    .hist-time{
      justify-self:end;
      min-width:92px;
      text-align:right;
      white-space:nowrap;
      font-size:13px;
      color:rgba(220,230,255,.9);
      padding-top:2px;
      display:flex;
      flex-direction:column;
      align-items:flex-end;
      gap:2px;
    }
    .hist-time .date{font-size:11px;color:rgba(173,186,220,.9);letter-spacing:.02em}
    .hist-time .clock{font-size:13px;font-weight:600;color:rgba(226,236,255,.95)}
    .hist-status{--hist-line-color:rgba(251,192,45,.8);--hist-icon-bg:rgba(251,192,45,.17);--hist-line-glow:rgba(251,192,45,.12)}
    .hist-status-waiting{--hist-line-color:rgba(251,192,45,.8);--hist-icon-bg:rgba(251,192,45,.17);--hist-line-glow:rgba(251,192,45,.12)}
    .hist-status-inproc{--hist-line-color:rgba(110,231,183,.85);--hist-icon-bg:rgba(14,159,110,.22);--hist-line-glow:rgba(14,159,110,.12)}
    .hist-status-processed{--hist-line-color:rgba(255,107,107,.85);--hist-icon-bg:rgba(255,107,107,.22);--hist-line-glow:rgba(255,107,107,.12)}
    .hist-problem{--hist-line-color:rgba(255,107,107,.82);--hist-icon-bg:rgba(255,107,107,.2)}
    .hist-replacement{--hist-line-color:rgba(143,124,255,.82);--hist-icon-bg:rgba(143,124,255,.22)}
    .hist-repl-outbound{--hist-line-color:rgba(251,192,45,.85);--hist-icon-bg:rgba(251,192,45,.18);--hist-line-glow:rgba(251,192,45,.12)}
    .hist-repl-shipped{--hist-line-color:rgba(56,189,248,.85);--hist-icon-bg:rgba(56,189,248,.18);--hist-line-glow:rgba(56,189,248,.12)}
    .hist-repl-return{--hist-line-color:rgba(249,115,22,.85);--hist-icon-bg:rgba(249,115,22,.18);--hist-line-glow:rgba(249,115,22,.12)}
    .hist-repl-arrived{--hist-line-color:rgba(110,231,183,.88);--hist-icon-bg:rgba(14,159,110,.22);--hist-line-glow:rgba(14,159,110,.12)}
    .hist-cdek{--hist-line-color:rgba(110,231,183,.82);--hist-icon-bg:rgba(14,159,110,.2)}
    .hist-review{--hist-line-color:rgba(96,165,250,.85);--hist-icon-bg:rgba(59,130,246,.2)}
    .hist-latest-status{
      background:linear-gradient(90deg,var(--hist-line-glow, rgba(251,192,45,.11)),rgba(0,0,0,0) 58%,rgba(0,0,0,0));
      box-shadow:inset 2px 0 0 var(--hist-line-color, rgba(251,192,45,.58));
    }
    .hist-session{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:6px 10px;
      margin:4px 0;
      border-radius:10px;
      border:1px dashed rgba(143,124,255,.35);
      background:rgba(15,20,32,.7);
      color:#dbe7ff;
      font-size:12px;
      font-weight:600;
    }
    .hist-session .meta{
      font-size:11px;
      color:var(--muted);
      font-weight:600;
      white-space:nowrap;
    }

    /* Таймлайн темы */
    #problemPanel[data-timeline-theme="doc"] #problemList{gap:10px}
    #problemPanel[data-timeline-theme="doc"] .timeline-list{border:none;background:transparent}
    #problemPanel[data-timeline-theme="doc"] .hist{
      border:1px solid rgba(255,255,255,.06);
      border-radius:14px;
      background:rgba(18,24,36,.92);
      box-shadow:0 12px 26px rgba(0,0,0,.28);
      padding:12px 14px;
    }
    #problemPanel[data-timeline-theme="doc"] .hist-rail::before{left:9px}
    #problemPanel[data-timeline-theme="doc"] .timeline-title{font-size:14px;letter-spacing:.01em}
    #problemPanel[data-timeline-theme="doc"] .timeline-text{color:#dbe4f6}
    #problemPanel[data-timeline-theme="doc"] .hist-time{color:rgba(216,226,248,.9);font-size:13px}

    #problemPanel[data-timeline-theme="console"] .timeline-list{
      border:1px solid rgba(130,105,248,.22);
      background:rgba(12,18,28,.85);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.02),0 10px 22px rgba(0,0,0,.22);
    }
    #problemPanel[data-timeline-theme="console"] .hist{background:rgba(15,22,34,.6)}

    #problemPanel[data-timeline-theme="compact"] #problemList{gap:6px}
    #problemPanel[data-timeline-theme="compact"] .hist{
      padding:8px 10px;
      grid-template-columns:18px minmax(0,1fr) auto;
    }
    #problemPanel[data-timeline-theme="compact"] .hist-icon{width:16px;height:16px;font-size:10px}
    #problemPanel[data-timeline-theme="compact"] .timeline-title{font-size:13px}
    #problemPanel[data-timeline-theme="compact"] .timeline-text{font-size:12px;margin-top:4px}
    #problemPanel[data-timeline-theme="compact"] .timeline-meta{font-size:11px}
    #problemPanel[data-timeline-theme="compact"] .hist-time{font-size:12px;min-width:80px;color:rgba(216,226,248,.86)}
    #problemPanel[data-timeline-theme="compact"] .pill{padding:1px 8px;font-size:11px}

    /* Таймлайн компоновка */
    #problemPanel[data-timeline-layout="tab"] .hist-rail::before{width:1px;left:11px;opacity:.85}
    #problemPanel[data-timeline-layout="tab"] .hist-icon{
      width:14px;height:18px;border-radius:6px;font-size:9px;
      box-shadow:none;border:1px solid var(--hist-line-color);background:var(--hist-icon-bg);
    }

    #problemPanel[data-timeline-layout="icon-card"] .hist{
      grid-template-columns:minmax(0,1fr) auto;
      padding-left:38px;
    }
    #problemPanel[data-timeline-layout="icon-card"] .hist-rail{
      position:absolute;
      left:12px;
      top:12px;
      width:16px;
      height:16px;
      align-self:auto;
    }
    #problemPanel[data-timeline-layout="icon-card"] .hist-rail::before{display:none}
    #problemPanel[data-timeline-layout="icon-card"] .hist-icon{
      width:16px;height:16px;border-radius:7px;font-size:10px;box-shadow:none;
    }

    #problemPanel[data-timeline-layout="line-behind"] .hist{
      padding-left:28px;
      background:rgba(16,22,34,.7);
      border-radius:12px;
      box-shadow:0 10px 20px rgba(0,0,0,.24);
    }
    #problemPanel[data-timeline-layout="line-behind"] .hist-rail{
      position:absolute;
      left:10px;
      top:0;
      bottom:0;
      align-self:auto;
    }
    #problemPanel[data-timeline-layout="line-behind"] .hist-rail::before{
      top:8px;bottom:8px;left:0;
    }
    #problemPanel[data-timeline-layout="line-behind"] .hist-icon{
      position:absolute;
      left:-7px;
      top:10px;
      box-shadow:none;
    }

    #problemPanel[data-timeline-layout="minimal"] .hist{
      grid-template-columns:minmax(0,1fr) auto;
      padding-left:12px;
      border-left:2px solid var(--hist-line-color);
    }
    #problemPanel[data-timeline-layout="minimal"] .hist-rail{display:none}
    #problemPanel[data-timeline-layout="minimal"] .hist-icon{display:none}

    /* Новый Compact+ */
    #problemPanel[data-timeline-layout="neutral-rail"] #problemList{gap:6px}
    #problemPanel[data-timeline-layout="neutral-rail"] .hist{
      padding:8px 10px;
      grid-template-columns:18px minmax(0,1fr) auto;
      border-bottom:1px solid rgba(255,255,255,.04);
      background:transparent;
    }
    #problemPanel[data-timeline-layout="neutral-rail"] .hist-rail::before{
      background:linear-gradient(180deg,rgba(160,175,210,.22),rgba(255,255,255,.02));
      width:1px;
      left:9px;
    }
    #problemPanel[data-timeline-layout="neutral-rail"] .hist-icon{
      width:14px;height:14px;font-size:9px;border-radius:6px;
      box-shadow:none;
      border:1px solid var(--hist-line-color);
      background:rgba(15,22,34,.9);
      color:var(--hist-line-color);
    }
    #problemPanel[data-timeline-layout="neutral-rail"] .timeline-title{font-size:13px}
    #problemPanel[data-timeline-layout="neutral-rail"] .timeline-text{font-size:12px;margin-top:4px}
    #problemPanel[data-timeline-layout="neutral-rail"] .timeline-meta{font-size:11px}
    #problemPanel[data-timeline-layout="neutral-rail"] .hist-time{font-size:12px;min-width:80px;color:rgba(216,226,248,.86)}

    #problemPanel[data-timeline-layout="inline-icon"] #problemList{gap:6px}
    #problemPanel[data-timeline-layout="inline-icon"] .hist{
      grid-template-columns:minmax(0,1fr) auto;
      padding:8px 10px;
      border-bottom:1px solid rgba(255,255,255,.04);
      background:transparent;
    }
    #problemPanel[data-timeline-layout="inline-icon"] .hist-rail{display:none}
    #problemPanel[data-timeline-layout="inline-icon"] .hist-icon{display:none}
    #problemPanel[data-timeline-layout="inline-icon"] .timeline-title{
      position:relative;
      padding-left:20px;
    }
    #problemPanel[data-timeline-layout="inline-icon"] .timeline-title::before{
      content:attr(data-icon);
      position:absolute;
      left:0;top:0.5px;
      width:14px;height:14px;
      display:flex;align-items:center;justify-content:center;
      border-radius:6px;
      font-size:9px;
      color:var(--hist-line-color);
      border:1px solid var(--hist-line-color);
      background:rgba(15,22,34,.9);
    }
    /* Inline icon variants */
    #problemPanel[data-timeline-layout="inline-icon"][data-timeline-inline="solid"] .timeline-title::before{
      background:var(--hist-line-color);
      color:#fff;
      border:none;
      box-shadow:0 4px 8px rgba(0,0,0,.25);
    }
    #problemPanel[data-timeline-layout="inline-icon"][data-timeline-inline="outline"] .timeline-title::before{
      background:transparent;
      color:var(--hist-line-color);
      border:1px solid var(--hist-line-color);
      box-shadow:none;
    }
    #problemPanel[data-timeline-layout="inline-icon"][data-timeline-inline="badge"] .timeline-title::before{
      width:16px;height:16px;top:-1px;
      background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(0,0,0,.05)),var(--hist-line-color);
      color:#fff;
      border:1px solid rgba(255,255,255,.25);
      box-shadow:0 6px 12px rgba(0,0,0,.28),0 0 0 2px rgba(0,0,0,.15);
      font-size:10px;
    }
    #problemPanel[data-timeline-layout="inline-icon"][data-timeline-inline="dot"] .timeline-title{
      padding-left:18px;
    }
    #problemPanel[data-timeline-layout="inline-icon"][data-timeline-inline="dot"] .timeline-title::before{
      content:'';
      width:6px;height:6px;top:6px;
      border-radius:50%;
      background:var(--hist-line-color);
      border:none;
      box-shadow:none;
    }
    #problemPanel[data-timeline-layout="inline-icon"][data-timeline-inline="dot"] .timeline-title::after{
      content:attr(data-short);
      position:absolute;
      left:10px;top:-1px;
      font-size:9px;
      font-weight:700;
      letter-spacing:.04em;
      color:var(--hist-line-color);
    }
    #problemPanel[data-timeline-layout="inline-icon"] .timeline-text{font-size:12px;margin-top:4px}
    #problemPanel[data-timeline-layout="inline-icon"] .timeline-meta{font-size:11px}
    #problemPanel[data-timeline-layout="inline-icon"] .hist-time{font-size:12px;min-width:80px;color:rgba(216,226,248,.86)}

    /* Иконка: варианты */
    #problemPanel[data-timeline-icon="emblem"] .hist{grid-template-columns:42px minmax(0,1fr) auto}
    #problemPanel[data-timeline-icon="emblem"] .hist-rail::before{left:18px}
    #problemPanel[data-timeline-icon="emblem"] .hist-icon{
      width:36px;height:36px;border-radius:50%;
      background:rgba(0,0,0,.4);
      border:1px solid rgba(255,255,255,.12);
      box-shadow:0 8px 18px rgba(0,0,0,.3);
      backdrop-filter:blur(8px);
      color:rgba(255,255,255,.9);
    }
    #problemPanel[data-timeline-icon="emblem"] .hist:hover .hist-icon{
      box-shadow:0 0 0 1px rgba(255,255,255,.16),0 12px 24px rgba(0,0,0,.32),0 0 14px var(--hist-line-color);
    }
    #problemPanel[data-timeline-icon="emblem"] .hist-icon svg{width:18px;height:18px}

    #problemPanel[data-timeline-icon="soft-pill"] .hist{grid-template-columns:minmax(0,1fr) auto;padding-left:12px}
    #problemPanel[data-timeline-icon="soft-pill"] .hist-rail{display:none}
    #problemPanel[data-timeline-icon="soft-pill"] .timeline-pills .pill{
      display:inline-flex;align-items:center;gap:8px;
      padding:6px 12px;border-radius:999px;
    }
    #problemPanel[data-timeline-icon="soft-pill"] .timeline-pills .pill::before{
      content:attr(data-icon);
      display:inline-flex;align-items:center;justify-content:center;
      width:16px;height:16px;border-radius:8px;
      background:rgba(0,0,0,.25);
      font-size:11px;line-height:1;
    }

    #problemPanel[data-timeline-icon="line-dot"] .timeline-pills .pill{display:none}
    #problemPanel[data-timeline-icon="line-dot"] .hist-icon{
      width:10px;height:10px;border-radius:50%;
      background:var(--hist-line-color);
      border:none;box-shadow:0 0 0 2px rgba(8,14,24,.85);
    }
    #problemPanel[data-timeline-icon="line-dot"] .hist-icon svg{display:none}

    #problemPanel[data-timeline-icon="gradient"] .hist-icon{
      border:1px solid transparent;
      background:
        linear-gradient(#0b1020, #0b1020) padding-box,
        linear-gradient(135deg,var(--hist-line-color),#22d3ee) border-box;
      box-shadow:0 8px 16px rgba(0,0,0,.28);
      color:#e9f1ff;
    }

    /* drag & drop overlay */
    .chat-body.drag-over{outline:2px dashed rgba(130,105,248,.55); outline-offset:-6px}
    .chat-body.drag-over::after{content:'Отпустите файлы для отправки';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:10px 14px;border-radius:10px;background:rgba(16,24,38,.92);border:1px solid rgba(130,105,248,.45);color:#dfe6ff;box-shadow:0 14px 28px rgba(0,0,0,.35)}
    /* attach preview */
    #attachPreview{display:none;position:relative;z-index:7;flex:0 0 auto;flex-direction:column;align-items:stretch;padding:8px 12px 10px;border-top:1px solid rgba(79,140,255,.14);background:linear-gradient(180deg,rgba(14,20,31,.88) 0%,rgba(11,16,25,.96) 100%)}
    #attachPreview .ap{display:grid;grid-template-columns:repeat(var(--ap-cols,1), minmax(0,1fr));gap:8px;align-items:stretch}
    #attachPreview .ap-item{display:flex;align-items:center;gap:8px;min-width:0;padding:8px 10px;border:1px solid var(--border);border-radius:12px;background:#0f1624}
    #attachPreview .ap-thumb{width:46px;height:46px;border-radius:10px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#0b0f18;color:#a8b3d1;font-size:18px;flex:0 0 auto}
    #attachPreview .ap-thumb img{width:100%;height:100%;object-fit:cover;display:block}
    #attachPreview .ap-thumb video{width:100%;height:100%;object-fit:cover;display:block}
    #attachPreview .ap-info{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1 1 auto}
    #attachPreview .ap-name{font-size:12px;color:#e6e8ee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    #attachPreview .ap-bar{width:100%;max-width:100%;height:6px;border-radius:6px;background:#1a2234;overflow:hidden}
    #attachPreview .ap-bar > div{height:100%;background:#8269f8}
    #attachPreview .ap-remove{border:none;background:#1b2234;color:#cdd6f5;border-radius:8px;padding:4px;cursor:pointer}
    #attachPreview .ap-progress{font-size:12px;color:#9bb4ff}
    #attachPreview .ap-actions{display:flex;align-items:center;gap:6px}
    #attachPreview.is-compact .ap{gap:6px}
    #attachPreview.is-compact .ap-item{padding:7px 8px;border-radius:10px}
    #attachPreview.is-compact .ap-thumb{width:40px;height:40px;border-radius:9px}
    #attachPreview.is-compact .ap-name,#attachPreview.is-compact .ap-progress{font-size:11px}
    #attachPreview.is-compact .ap-bar{height:5px}
    #attachPreview.is-dense .ap{gap:5px}
    #attachPreview.is-dense .ap-item{padding:6px 7px;border-radius:9px}
    #attachPreview.is-dense .ap-thumb{width:34px;height:34px;border-radius:8px;font-size:15px}
    #attachPreview.is-dense .ap-name,#attachPreview.is-dense .ap-progress{font-size:10px}
    #attachPreview.is-dense .ap-bar{height:4px}
    .hist-line{display:flex;align-items:center;gap:8px;margin-bottom:6px}
    .hist-op{font-size:12px;color:var(--text-2)}
    .timeline-title-row{display:flex;align-items:center;gap:8px;margin:4px 0 2px}
    .pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;border:1px solid var(--border)}
    .pill-waiting{background:rgba(251,192,45,.18);color:#fbc02d;border-color:#5a4a12}
    .pill-inproc{background:rgba(14,159,110,.16);color:#6ee7b7;border-color:#1a3a33}
    .pill-proc{background:rgba(255,107,107,.16);color:#ff6b6b;border-color:#4b1e1e}
    .pill-violet{background:var(--violet-light);color:#d6ceff;border-color:rgba(143,124,255,.45)}
    .pill-repl-outbound{--repl-dot-color:#fbc02d;background:rgba(251,192,45,.18);color:#fbc02d;border-color:rgba(251,192,45,.5)}
    .pill-repl-shipped{--repl-dot-color:#6ee7b7;background:rgba(14,159,110,.18);color:#6ee7b7;border-color:rgba(14,159,110,.55)}
    .pill-repl-return{--repl-dot-color:#fb923c;background:rgba(249,115,22,.18);color:#fb923c;border-color:rgba(249,115,22,.55)}
    .pill-repl-arrived{--repl-dot-color:#ff6b6b;background:rgba(255,107,107,.16);color:#ff6b6b;border-color:rgba(255,107,107,.55)}
    .pill-review{background:rgba(96,165,250,.18);color:#9fd2ff;border-color:rgba(96,165,250,.5)}
    .pill.repl-status{display:inline-flex;align-items:center;gap:6px}
    .pill.repl-status .repl-dot{
      width:6px;height:6px;border-radius:50%;
      background:var(--repl-dot-color, currentColor);
      box-shadow:0 0 0 2px rgba(0,0,0,.25);
      flex:0 0 auto;
    }
    #problemPanel[data-timeline-icon="soft-pill"] .timeline-pills .pill.repl-status::before{content:none;display:none}
    #problemPanel[data-timeline-icon="line-dot"] .timeline-pills .pill.repl-status{display:inline-block}
    .ctx{position:fixed;display:none;z-index:120;min-width:230px;padding:6px;border-radius:14px;border:1px solid rgba(255,255,255,.07);background:linear-gradient(180deg,rgba(42,50,58,.96) 0%,rgba(34,41,48,.98) 100%);box-shadow:0 20px 50px rgba(0,0,0,.34),0 4px 12px rgba(0,0,0,.24);backdrop-filter:blur(22px) saturate(140%);overflow:hidden;opacity:0;transform:translateY(-4px) scale(.985);pointer-events:none;transition:opacity .14s ease,transform .14s ease}
    .ctx.open{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}
    .ctx .ctx-reactions{display:flex;align-items:center;gap:4px;padding:2px 2px 8px;margin:0 0 4px;border-bottom:1px solid rgba(255,255,255,.06)}
    .ctx .ctx-reaction{width:34px;height:34px;border:0;border-radius:17px;background:transparent;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer;transition:background .14s ease,transform .14s ease,box-shadow .14s ease}
    .ctx .ctx-reaction:hover{background:rgba(255,255,255,.09)}
    .ctx .ctx-reaction.active{background:rgba(81,160,255,.18);box-shadow:inset 0 0 0 1px rgba(107,184,255,.26)}
    .ctx .ctx-reaction img.emoji{width:20px;height:20px}
    .ctx .i{display:flex;align-items:center;gap:10px;min-height:36px;padding:8px 10px;border-radius:10px;font-size:14px;font-weight:500;cursor:pointer;color:#f5f7fb;transition:background .14s ease,color .14s ease}
    .ctx .i + .i{margin-top:1px}
    .ctx .i .icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;color:rgba(239,245,255,.82);flex:0 0 20px}
    .ctx .i .icon svg{width:18px;height:18px;display:block}
    .ctx .i .txt{flex:1;line-height:1.25}
    .ctx .i:hover{background:rgba(255,255,255,.085)}
    .ctx .i.danger{color:#ff7e87}
    .ctx .i.danger .icon{color:#ff7e87}
    .ctx .i.danger:hover{background:rgba(255,98,107,.12)}
    .ctx .i.disabled{opacity:.4;cursor:default;pointer-events:none}
    .ctx.compact{min-width:186px;padding:6px}
    .ctx.compact .i{min-height:32px;padding:7px 9px;font-size:13px}
    .ctx.compact .i .icon{width:18px;height:18px;flex-basis:18px}
    .ctx.compact .i .icon svg{width:16px;height:16px}
    #ctxMenu,#ctxClients,#ctxOrders,#configTemplateCtx{min-width:208px}

    .message-reactions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;max-width:100%;margin-top:6px}
    .message-reaction{display:inline-flex;align-items:center;gap:5px;min-height:24px;padding:3px 8px;border-radius:999px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.07);color:#eef4ff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);cursor:pointer;transition:background .14s ease,border-color .14s ease,transform .14s ease}
    .message-reaction:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.14)}
    .message-reaction.mine{background:rgba(83,164,255,.24);border-color:rgba(121,189,255,.34)}
    .message-reaction.peer{box-shadow:inset 0 0 0 1px rgba(255,255,255,.03)}
    .message-reaction:active{transform:translateY(1px)}
    .message-reaction-emoji{display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:1}
    .message-reaction-emoji img.emoji{width:15px;height:15px}
    .message-reaction-peer-avatar{width:16px;height:16px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex:0 0 16px;font-size:9px;font-weight:700;line-height:1;color:#eaf2ff;background:linear-gradient(180deg,rgba(113,146,193,.95) 0%,rgba(82,111,153,.95) 100%);border:1px solid rgba(255,255,255,.22);box-shadow:0 1px 4px rgba(0,0,0,.24);background-size:cover;background-position:center;background-repeat:no-repeat;overflow:hidden}
    .message-reaction-peer-avatar.operator{background:linear-gradient(180deg,rgba(97,178,255,.98) 0%,rgba(56,129,228,.98) 100%);border-color:rgba(207,231,255,.28);color:#f7fbff}
    .message-reaction-peer-avatar.avatar-image{color:transparent}
    .message-reaction-count{font-size:12px;font-weight:600;line-height:1;color:rgba(244,248,255,.88)}

    /* ───── Animations ───────────────────────────────────────────── */
    @keyframes msgFadeIn{0%{opacity:0;transform:translateY(12px);}100%{opacity:1;transform:translateY(0);}}
    @keyframes msgBounce{0%{transform:scale(0.98) translateY(0);}40%{transform:scale(1.02) translateY(-5px);}70%{transform:scale(0.995) translateY(2px);}100%{transform:scale(1) translateY(0);}}
    @keyframes typingBlink{0%,80%,100%{opacity:.35;transform:translateY(0);}40%{opacity:1;transform:translateY(-2px);}}
    @keyframes pcNoReplyAttention{
      0%{transform:translateX(0) translateY(0) scale(1);box-shadow:0 0 0 1px rgba(251,192,45,.45), 0 16px 28px rgba(50,32,10,.38)}
      22%{transform:translateX(-1.5px) translateY(-1px) scale(1.006);box-shadow:0 0 0 1px rgba(251,192,45,.55), 0 16px 24px rgba(50,32,10,.46)}
      48%{transform:translateX(1.5px) translateY(1px) scale(1.012);box-shadow:0 0 0 1px rgba(251,192,45,.68), 0 18px 30px rgba(83,54,16,.48)}
      76%{transform:translateX(-1px) translateY(-1px) scale(1.006);box-shadow:0 0 0 1px rgba(251,192,45,.6), 0 16px 28px rgba(50,32,10,.42)}
      100%{transform:translateX(0) translateY(0) scale(1);box-shadow:0 0 0 1px rgba(251,192,45,.45), 0 16px 28px rgba(50,32,10,.38)}
    }
    @keyframes statusGradient{0%{background-position:0% 50%;}100%{background-position:100% 50%;}}
    @keyframes statusPulse{0%{box-shadow:0 0 0 0 rgba(79,140,255,.45);}100%{box-shadow:0 0 0 16px rgba(79,140,255,0);}}
    @keyframes histPop{0%{opacity:0;transform:translateY(12px) scale(.9);}60%{opacity:1;transform:translateY(-4px) scale(1.03);}100%{opacity:1;transform:translateY(0) scale(1);}}
    @keyframes histGlow{0%{box-shadow:0 0 0 0 rgba(130,105,248,.6);}100%{box-shadow:0 0 18px 6px rgba(130,105,248,0);}}
    @keyframes dropdownReveal{0%{opacity:0;transform:translateY(-14px);}100%{opacity:1;transform:translateY(0);}}
    @keyframes chatSlideIn{0%{opacity:0;transform:translateX(24px);}100%{opacity:1;transform:translateX(0);}}
    @keyframes pinRise{0%{transform:translateY(12px) scale(.95);}60%{transform:translateY(-4px) scale(1.04);}100%{transform:translateY(0) scale(1);}}
    @keyframes messageHighlight{0%{box-shadow:0 0 0 0 rgba(143,124,255,.0);}50%{box-shadow:0 0 0 6px rgba(143,124,255,.28);}100%{box-shadow:0 0 0 0 rgba(143,124,255,0);}}
    @keyframes messageFadeOut{0%{opacity:1;transform:translateY(0);}100%{opacity:0;transform:translateY(10px);} }
    @keyframes messageFadeOutScale{0%{opacity:1;transform:scale(1);}100%{opacity:0;transform:scale(.92);} }

    #chat.chat-enter{animation:chatSlideIn .36s ease both;}
    #chat .row.msg-enter{animation:msgFadeIn .32s ease-out both;}
    #chat .row.msg-operator .bubble{animation:msgBounce .38s cubic-bezier(.21,1.01,.22,1) both;}
    #chat .bubble.edited-flash{animation:messageHighlight 1.1s ease;}
    #chat .row.pinned-fresh .bubble{animation:pinRise .45s ease;}
    #chat .row.message-removing{animation:messageFadeOut .32s ease forwards;}
    #chat .row.message-removing .bubble{animation:messageFadeOutScale .32s ease forwards;}

    .badge.status-animate{background-image:linear-gradient(120deg,rgba(251,192,45,.65),rgba(110,231,183,.65));background-size:200% 200%;color:#0b1724;border-color:rgba(110,231,183,.55);animation:statusGradient .8s ease forwards,statusPulse .8s ease forwards;}

    .hist.hist-new{animation:histPop .5s ease forwards;}
    .hist.hist-new::after{animation:histGlow .6s ease-out forwards;}

    .modal{transition:opacity .28s ease, transform .28s ease;opacity:0;transform:translateY(-12px);}
    .modal.open{opacity:1;transform:translateY(0);}
    .modal .card{transform:translateY(-18px);opacity:0;transition:transform .32s ease, opacity .32s ease;}
    .modal.open .card{transform:translateY(0);opacity:1;}
    /* Плавное (медленное) раскрытие панели поиска */
    .chat-search-panel{display:flex;flex-direction:column;max-height:0;opacity:0;overflow:hidden;padding:0 12px;background:rgba(20,26,38,.96);border-bottom:0;box-shadow:none;align-items:flex-start;gap:10px;transform:translateY(-6px);transition:max-height .42s cubic-bezier(.2,.7,.2,1), opacity .42s ease, padding .42s ease, transform .42s ease, border-bottom .2s ease;pointer-events:none}
    .chat-search-panel.open{max-height:260px;opacity:1;padding:10px 12px;transform:none;pointer-events:auto;border-bottom:1px solid rgba(143,124,255,.18);box-shadow:0 12px 24px rgba(0,0,0,.28)}
    .chat-search-panel .search-row{display:flex;align-items:center;gap:8px}
    .chat-search-panel input{flex:1;padding:6px 10px;border-radius:8px;border:1px solid rgba(143,124,255,.25);background:#121826;color:var(--text)}
    .chat-search-panel input:focus{outline:none;border-color:rgba(143,124,255,.45);box-shadow:0 0 0 2px rgba(143,124,255,.2)}
    .chat-search-panel .results{max-height:220px;overflow-y:auto;margin-top:8px;display:flex;flex-direction:column;gap:6px}
    .chat-search-panel .result{padding:8px 10px;border-radius:8px;background:rgba(143,124,255,.12);cursor:pointer;transition:background .2s ease}
    .chat-search-panel .result:hover{background:rgba(143,124,255,.22)}
    .chat-search-panel .result .meta{font-size:11px;opacity:.8;margin-top:2px}
    /* компактная строка результата: текст слева, время справа */
    .chat-search-panel .result .line{display:flex;align-items:center;justify-content:space-between;gap:8px}
    .chat-search-panel .result .line .text{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .chat-search-panel .result .line .time{font-size:11px;opacity:.8;margin-left:8px;white-space:nowrap}
    /* При активном мультивыборе смещаем FAB поиска ниже (с анимацией) */
    .chat-body.select-mode .chat-search-fab{transform:translateY(42px)}
    @media (prefers-reduced-motion: reduce){
      .client-item.pc-no-reply-attention{
        animation: none;
        box-shadow:0 0 0 1px rgba(251,192,45,.4)!important;
        background: linear-gradient(155deg, rgba(66,44,12,.34), rgba(42,28,12,.36))!important;
      }
    }

    .global-search-panel{position:relative;margin-top:0;max-height:0;opacity:0;overflow:hidden;padding:0 12px;background:rgba(18,24,36,.92);border-radius:10px;box-shadow:0 16px 30px rgba(0,0,0,.28);transform:translateY(-6px);transition:max-height var(--motion-slow) var(--ease-in-out),opacity var(--motion-mid) var(--ease-out),padding var(--motion-mid) var(--ease-out),transform var(--motion-mid) var(--ease-out),margin-top var(--motion-fast) var(--ease-out);pointer-events:none}
    .global-search-panel.open{margin-top:10px;max-height:360px;opacity:1;padding:10px 12px;transform:none;pointer-events:auto}
    /* unified-search: внутреннюю строку поиска скрываем, оставляем только результаты */
    .global-search-panel .search-row{display:none}
    .global-search-panel input{flex:1;padding:6px 10px;border-radius:8px;border:1px solid rgba(143,124,255,.25);background:#121826;color:var(--text)}
    .global-search-panel input:focus{outline:none;border-color:rgba(143,124,255,.45);box-shadow:0 0 0 2px rgba(143,124,255,.2)}
    .global-search-panel .results{max-height:260px;overflow-y:auto;display:flex;flex-direction:column;gap:6px}
    .global-search-panel .result{padding:8px 10px;border-radius:8px;background:rgba(143,124,255,.1);cursor:pointer;transition:background .2s ease}
    .global-search-panel .result:hover{background:rgba(143,124,255,.18)}
    .global-search-panel .result .meta{font-size:11px;opacity:.8;margin-top:2px}
    .global-search-panel .result .line{display:flex;align-items:center;justify-content:space-between;gap:8px}
    .global-search-panel .result .line .left{display:flex;align-items:center;gap:6px;min-width:0;flex:1}
    .global-search-panel .result .line .text{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .global-search-panel .result .line .time{font-size:11px;opacity:.8;margin-left:8px;white-space:nowrap}
    .global-search-panel .section-title{font-weight:600;font-size:13px;color:rgba(143,124,255,.7);margin-top:4px}
    .modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.6);z-index:70}
    .modal .card{background:#0f131c;border:1px solid #242a36;border-radius:12px;box-shadow:var(--shadow);max-width:900px;width:92%}
    .modal .card.orders-card{max-width:1280px;width:min(1280px,calc(100vw - 32px));height:min(90vh,940px)}
    .modal .card.orders-card .body.orders-body{overflow:hidden}
    .modal .config-card{max-width:1500px;width:94vw;position:relative}
    .modal .head{padding:10px 12px;border-bottom:1px solid #242a36;display:flex;justify-content:space-between;align-items:center}
    .modal .body{padding:12px;overflow:auto}
    .image-editor-card{max-width:min(1280px,96vw);width:min(1280px,96vw)}
    .image-editor-body{display:flex;flex-direction:column;gap:14px}
    .image-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
    .image-editor-colors{display:flex;align-items:center;gap:8px}
    .image-editor-swatch{width:30px;height:30px;border-radius:999px;border:2px solid rgba(255,255,255,.2);background:var(--swatch,#ff4d4f);cursor:pointer;box-shadow:0 6px 14px rgba(0,0,0,.22)}
    .image-editor-swatch.active{border-color:#e6f0ff;box-shadow:0 0 0 3px rgba(94,148,255,.28)}
    .image-editor-color-picker{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
    .image-editor-color-picker input{width:40px;height:32px;border:none;background:transparent;padding:0;cursor:pointer}
    .image-editor-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
    .image-editor-canvas-wrap{display:flex;align-items:center;justify-content:center;min-height:320px;max-height:72vh;overflow:auto;padding:12px;border-radius:16px;border:1px solid rgba(130,105,248,.22);background:rgba(9,13,22,.92)}
    #imageEditorCanvas{display:block;max-width:100%;height:auto;border-radius:14px;cursor:crosshair;box-shadow:0 18px 36px rgba(0,0,0,.35);touch-action:none;background:#000}
    .image-editor-hint{font-size:12px;color:var(--muted);text-align:center}
    .repl-arrived-code{font-size:24px;letter-spacing:6px;font-weight:700;text-align:center;padding:10px 12px;border-radius:12px;background:rgba(130,105,248,.18);border:1px solid rgba(130,105,248,.45);color:#eef1ff;margin:8px 0 10px}
    .repl-arrived-hint{font-size:12px;color:rgba(173,186,220,.78);margin-bottom:8px}
    .repl-arrived-input{font-size:16px;text-align:center;letter-spacing:6px}
    .repl-arrived-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
    .logistics-card{max-width:1280px;width:min(1280px,95vw);height:min(84vh,860px);display:flex;flex-direction:column}
    .logistics-card .body{overflow:hidden}
    .logistics-body{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0}
    .logistics-toolbar{display:flex;flex-direction:column;gap:8px}
    .logistics-row{display:flex;align-items:center;gap:8px}
    .logistics-row-top{flex-wrap:nowrap}
    .logistics-row-bottom{flex-wrap:nowrap}
    .logistics-search{flex:1 1 auto;min-width:240px}
    .logistics-select{flex:0 0 160px;min-width:140px}
    .logistics-tabs{display:flex;align-items:center;gap:6px;padding:4px;border:1px solid rgba(130,105,248,.22);border-radius:12px;background:rgba(18,26,40,.65)}
    .logistics-tab{border:1px solid transparent;background:transparent;color:var(--text-2);padding:7px 10px;border-radius:10px;font-size:12px;font-weight:700;cursor:pointer}
    .logistics-tab.active{background:rgba(130,105,248,.3);color:#f4f1ff;border-color:rgba(130,105,248,.5)}
    .logistics-layout{display:grid;grid-template-columns:minmax(300px,36%) minmax(0,1fr);gap:12px;min-height:0;flex:1}
    .logistics-list,.logistics-detail{border:1px solid rgba(130,105,248,.2);border-radius:12px;background:rgba(13,20,32,.78);min-height:0}
    .logistics-list{display:flex;flex-direction:column;overflow:auto;padding:8px;gap:8px}
    .logistics-item{border:1px solid rgba(130,105,248,.18);border-radius:10px;padding:10px;background:rgba(18,26,40,.78);cursor:pointer}
    .logistics-item:hover{border-color:rgba(130,105,248,.42);transform:translateY(-1px)}
    .logistics-item.active{border-color:rgba(110,231,183,.6);box-shadow:0 10px 18px rgba(16,185,129,.18)}
    .logistics-item-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
    .logistics-item-title{font-weight:700;color:#edf2ff}
    .logistics-item-meta{font-size:12px;color:var(--muted)}
    .logistics-item-sub{font-size:12px;color:#d2dcf4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .logistics-date{flex:0 0 135px;min-width:120px}
    .logistics-row-top .logistics-select{flex:0 0 150px;min-width:135px}
    .logistics-row-top .logistics-date{flex:0 0 135px;min-width:120px}
    .logistics-detail{padding:12px;overflow:auto;display:flex;flex-direction:column;gap:10px}
    .logistics-detail-main{display:flex;flex-direction:column;gap:10px;min-height:0}
    .logistics-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .logistics-detail-card{padding:10px;border:1px solid rgba(130,105,248,.2);border-radius:10px;background:rgba(18,26,40,.72)}
    .logistics-detail-card.clickable{cursor:pointer;border-color:rgba(130,105,248,.48);box-shadow:0 0 0 1px rgba(130,105,248,.18) inset}
    .logistics-detail-card.clickable:hover{background:rgba(31,44,66,.86)}
    .logistics-detail-label{font-size:11px;color:var(--muted);margin-bottom:4px;text-transform:uppercase;letter-spacing:.06em}
    .logistics-detail-value{font-size:13px;color:#edf2ff;word-break:break-word}
    .logistics-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
    .logistics-status-block{margin-top:12px;padding:10px;border:1px solid rgba(130,105,248,.22);border-radius:12px;background:rgba(18,26,40,.72)}
    .logistics-status-block.bottom{margin-top:auto}
    .logistics-status-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:4px;border:1px solid rgba(130,105,248,.24);border-radius:12px;background:rgba(14,21,33,.88)}
    .logistics-status-btn{border:1px solid transparent;background:transparent;color:var(--text-2);font-size:12px;font-weight:700;line-height:1.2;padding:8px;border-radius:9px;cursor:pointer;transition:color .16s ease,background .16s ease,border-color .16s ease}
    .logistics-status-btn:hover{color:#e8eeff}
    .logistics-status-btn.active{background:linear-gradient(180deg,rgba(130,105,248,.34),rgba(103,86,219,.3));border-color:rgba(130,105,248,.5);color:#f2f0ff}
    .logistics-status-note{margin-top:6px;font-size:12px;color:var(--muted)}
    .logistics-shipments{display:flex;flex-direction:column;gap:8px;margin-top:10px}
    .logistics-shipment{padding:8px;border:1px solid rgba(130,105,248,.16);border-radius:8px;background:rgba(16,24,38,.62);font-size:12px;color:#d2dcf4}
    .logistics-empty{padding:18px 12px;color:var(--muted);text-align:center}
    @media (max-width: 1080px){
      .logistics-layout{grid-template-columns:1fr}
      .logistics-detail-grid{grid-template-columns:1fr}
    }
    .bug-report-card{max-width:min(980px,94vw);width:min(980px,94vw)}
    .bug-report-body{display:flex;flex-direction:column;gap:12px;max-height:min(78vh,760px)}
    .bug-report-note{font-size:12px;color:var(--muted)}
    .bug-report-form,.bug-report-admin{display:flex;flex-direction:column;gap:12px;min-height:0}
    .bug-report-field{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}
    .bug-report-textarea{width:100%;min-height:180px;resize:vertical}
    .bug-report-upload-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
    .bug-report-upload-hint{font-size:12px;color:var(--muted)}
    .bug-report-preview-list{display:flex;flex-wrap:wrap;gap:10px}
    .bug-report-preview-item{position:relative;width:110px;height:110px;border-radius:12px;overflow:hidden;border:1px solid rgba(130,105,248,.22);background:rgba(13,20,32,.7);box-shadow:0 10px 18px rgba(0,0,0,.24)}
    .bug-report-preview-item img{width:100%;height:100%;object-fit:cover;display:block;cursor:pointer}
    .bug-report-preview-remove{position:absolute;top:6px;right:6px;width:24px;height:24px;border:none;border-radius:999px;background:rgba(6,10,20,.74);color:#fff;font-size:15px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
    .bug-report-preview-remove:hover{background:rgba(255,107,107,.82)}
    .bug-report-actions{display:flex;justify-content:flex-end;gap:8px}
    .move-to-pc-card{max-width:min(560px,92vw);width:min(560px,92vw)}
    .move-to-pc-body{display:flex;flex-direction:column;gap:12px}
    .move-to-pc-note{font-size:12px;color:var(--muted)}
    .move-to-pc-field{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}
    .move-to-pc-textarea{width:100%;min-height:120px;resize:vertical}
    .move-to-pc-actions{display:flex;justify-content:flex-end;gap:8px}
    .bug-report-status{min-height:18px;font-size:12px;color:var(--muted)}
    .bug-report-status.is-error{color:#ff9f9f}
    .bug-report-status.is-success{color:#a7f3d0}
    .bug-report-list{display:flex;flex-direction:column;gap:10px;overflow:auto;min-height:0;padding-right:4px}
    .bug-report-item{border:1px solid rgba(130,105,248,.18);border-radius:12px;background:rgba(18,26,40,.78);padding:12px}
    .bug-report-item-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}
    .bug-report-item-meta-wrap{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
    .bug-report-item-kind{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
    .bug-report-item-kind.is-complaint{background:rgba(255,107,107,.16);border:1px solid rgba(255,107,107,.35);color:#ffc5c5}
    .bug-report-item-kind.is-suggestion{background:rgba(110,231,183,.16);border:1px solid rgba(110,231,183,.35);color:#c8ffea}
    .bug-report-item.is-processed{border-color:rgba(110,231,183,.34);background:rgba(14,34,25,.7)}
    .bug-report-item.is-processed .bug-report-item-message{color:#d9ffe8}
    .bug-report-item.is-processed .bug-report-item-author{color:#d9ffe8}
    .bug-report-item-meta{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-size:12px;color:var(--muted);text-align:right}
    .bug-report-item-author{font-weight:600;color:#e6ebff}
    .bug-report-item-processed{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:11px;white-space:nowrap}
    .bug-report-item-processed-input{width:14px;height:14px;cursor:pointer}
    .bug-report-item-message{white-space:pre-wrap;word-break:break-word;color:#edf2ff;line-height:1.55}
    .bug-report-item-attachments{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
    .bug-report-item-attachments img{width:140px;height:140px;object-fit:cover;display:block;border-radius:12px;border:1px solid rgba(130,105,248,.18);background:rgba(13,20,32,.7);cursor:pointer}
    .bug-report-empty{padding:18px 12px;color:var(--muted);text-align:center;border:1px dashed rgba(130,105,248,.22);border-radius:12px;background:rgba(13,20,32,.5)}
    .config-card{max-width:1500px;width:94vw;position:relative}
    .config-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;align-items:start}
    .config-main{display:flex;flex-direction:column;gap:12px;min-width:0}
    .config-summary{position:sticky;top:128px;align-self:start;margin-top:6px}
    .config-summary-card{background:linear-gradient(180deg,rgba(18,24,36,.96),rgba(14,20,30,.94));border:1px solid rgba(79,140,255,.18);border-radius:14px;padding:14px;box-shadow:0 12px 26px rgba(6,12,24,.38);transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .config-summary-card:hover{transform:translateY(-1px);box-shadow:0 16px 30px rgba(6,12,24,.45)}
    .config-summary-head{font-size:18px;font-weight:700;margin-bottom:10px}
    .config-summary-field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;font-size:12px;color:var(--muted)}
    .config-summary-input{display:flex;align-items:center;gap:8px}
    .config-summary-input .input{flex:1;min-width:0}
    .config-summary-input .suffix{font-size:12px;color:rgba(196,210,236,.75)}
    .config-head-left{display:flex;align-items:center;gap:10px}
    .config-back{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:8px;border:1px dashed rgba(143,124,255,.4);color:rgba(226,235,255,.9);background:rgba(18,24,36,.6);font-weight:600;transition:transform var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out),background-color var(--motion-fast) var(--ease-out)}
    .config-back::before{content:"←";font-size:14px;opacity:.85}
    .config-back:hover{border-color:rgba(143,124,255,.7);color:#f1f6ff}
    .config-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:12px}
    .config-actions{display:grid;grid-template-columns:minmax(0,0.9fr) minmax(0,0.95fr) minmax(0,1.15fr);gap:10px;align-items:stretch;width:100%}
    .config-action-cluster{--accent:99,102,241;display:flex;flex-direction:column;gap:6px;padding:8px 10px;border-radius:12px;background:rgba(18,26,42,.7);border:1px solid rgba(98,128,190,.25);min-width:0;position:relative;width:100%}
    .config-action-cluster::after{content:"";position:absolute;left:10px;right:10px;top:6px;height:2px;border-radius:999px;background:linear-gradient(90deg,rgba(var(--accent),.8),rgba(var(--accent),.12))}
    .config-action-title{font-size:10px;letter-spacing:.18em;text-transform:uppercase;color:rgba(196,210,236,.7);padding-top:6px}
    .config-action-buttons{display:flex;flex-wrap:nowrap;gap:6px;align-items:flex-start;width:100%;justify-content:space-between}
    .config-action-cluster.accent-fill{--accent:99,102,241}
    .config-action-cluster.accent-order{--accent:34,197,94}
    .config-action-cluster.accent-copy{--accent:56,189,248}
    /* full-width clusters */
    .config-btn{display:inline-flex;align-items:center;gap:5px;font-weight:600;font-size:11px;line-height:1.1;padding:4px 7px;border-radius:9px;white-space:nowrap;min-height:26px}
    .config-btn::before{content:"";width:13px;height:13px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;font-size:9px;color:#cfe1ff;background:rgba(var(--accent),.18);border:1px solid rgba(var(--accent),.35)}
    .config-btn[data-ico="parse"]::before{content:"✦"}
    .config-btn[data-ico="clear"]::before{content:"⌫"}
    .config-btn[data-ico="order"]::before{content:"＋"}
    #configCreateOrderBtn{margin-top:0}
    .config-btn[data-ico="copy"]::before{content:"⎘"}
    .config-btn[data-ico="client"]::before{content:"◎"}
    .config-action-cluster .config-btn.primary{background:linear-gradient(180deg,rgba(var(--accent),.32),rgba(var(--accent),.22));border-color:rgba(var(--accent),.6);color:#eef2ff;box-shadow:0 10px 18px rgba(var(--accent),.18)}
    .config-action-cluster .config-btn.ghost{background:rgba(18,26,40,.55);border-color:rgba(var(--accent),.25);color:#d7e2ff}
    /* no fixed widths */
    .config-action-buttons.order-actions{display:grid;grid-template-columns:1fr auto;align-items:start;column-gap:8px;width:100%}
    .config-action-buttons.order-actions .order-left{display:flex;flex-direction:column;gap:6px;min-width:0;align-self:start;margin-top:-8px}
    .config-delete-order{padding:4px 7px;font-size:11px;background:rgba(255,107,107,.14);border:1px solid rgba(255,107,107,.5);color:#ffd1d1;box-shadow:0 8px 18px rgba(255,107,107,.15);justify-content:center;z-index:2;display:flex;align-items:center;white-space:nowrap;min-height:26px;margin-top:-8px}
    .config-delete-order:hover{background:rgba(255,107,107,.22);border-color:rgba(255,107,107,.75)}
    .config-builds{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
    .config-builds-list{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
    .config-build-tab{border:1px solid rgba(79,140,255,.22);background:rgba(20,28,42,.7);color:var(--text);padding:6px 12px;border-radius:999px;font-weight:600;font-size:13px;letter-spacing:.02em;cursor:pointer;transition:background .2s ease,border-color .2s ease,transform .2s ease;min-width:0}
    .config-build-tab:hover{background:rgba(32,46,70,.78);border-color:rgba(79,140,255,.4);transform:translateY(-1px)}
    .config-build-tab.active{background:rgba(79,140,255,.2);border-color:rgba(79,140,255,.55);color:#e6efff;box-shadow:0 10px 18px rgba(79,140,255,.16)}
    .config-build-add{width:34px;height:34px;border-radius:50%;border:1px dashed rgba(79,140,255,.45);background:rgba(18,26,40,.7);color:#cfe0ff;font-size:18px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .2s ease,border-color .2s ease,transform .2s ease}
    .config-build-add:hover{background:rgba(28,40,64,.82);border-color:rgba(79,140,255,.7);transform:translateY(-1px)}
    .config-build-input{width:120px;max-width:160px;background:transparent;border:none;color:var(--text);font-weight:600;font-size:13px;outline:none}
    .config-build-menu{position:absolute;min-width:200px;background:rgba(13,18,30,.98);border:1px solid rgba(148,163,184,.22);border-radius:12px;padding:6px;box-shadow:0 12px 24px rgba(0,0,0,.45);display:none;z-index:1200;opacity:0;transform:translateY(-6px) scale(.98);pointer-events:none;transition:opacity var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out)}
    .config-build-menu.open{display:block;opacity:1;transform:translateY(0) scale(1);pointer-events:auto}
    .config-build-menu button{width:100%;border:1px solid transparent;background:transparent;color:#e5e7eb;text-align:left;padding:8px 12px;border-radius:8px;font-size:13px;cursor:pointer;transition:background-color var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out),color var(--motion-fast) var(--ease-out)}
    .config-build-menu button:hover{background:rgba(148,163,184,.14);border-color:rgba(148,163,184,.2)}
    .config-build-menu button:disabled{opacity:.55;cursor:not-allowed;background:rgba(120,130,160,.12);border-color:rgba(120,130,160,.12)}
    .config-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
    .config-meta label{font-size:12px;color:var(--muted)}
    .config-table-wrap{border:1px solid rgba(79,140,255,.18);border-radius:14px;background:linear-gradient(180deg,rgba(18,24,36,.96),rgba(15,20,30,.96));overflow:auto;max-height:60vh;padding:6px;transition:transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .config-table-wrap:hover{transform:translateY(-1px);box-shadow:0 16px 30px rgba(6,12,24,.45)}
    .config-table{width:100%;border-collapse:separate;table-layout:fixed;border-spacing:0 8px}
    .config-table th,.config-table td{padding:8px 10px;text-align:left}
    .config-table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:rgba(196,210,236,.75);background:rgba(20,26,38,.95);position:sticky;top:0;z-index:1;border-bottom:1px solid rgba(255,255,255,.06)}
    .config-table td{background:rgba(18,26,40,.86);border-top:1px solid rgba(255,255,255,.04);border-bottom:1px solid rgba(255,255,255,.04);transition:background-color var(--motion-fast) var(--ease-out),border-color var(--motion-fast) var(--ease-out)}
    .config-table td:first-child{border-left:1px solid rgba(255,255,255,.04);border-top-left-radius:12px;border-bottom-left-radius:12px}
    .config-table td:last-child{border-right:1px solid rgba(255,255,255,.04);border-top-right-radius:12px;border-bottom-right-radius:12px}
    .config-table td input{width:100%;min-width:0}
    .config-table input.config-cost::-webkit-outer-spin-button,
    .config-table input.config-cost::-webkit-inner-spin-button,
    .config-table input.config-qty::-webkit-outer-spin-button,
    .config-table input.config-qty::-webkit-inner-spin-button,
    #configClientPercent::-webkit-outer-spin-button,
    #configClientPercent::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
    .config-table input.config-cost,
    .config-table input.config-qty,
    #configClientPercent{ -moz-appearance: textfield; appearance: textfield; }
    .config-table .num{width:48px;color:rgba(190,205,235,.8)}
    .config-table .qty,.config-table .cost{width:100%;text-align:right}
    .config-row-total{white-space:nowrap;text-align:right;font-weight:600}
    .config-table th:nth-child(1), .config-table td:nth-child(1){width:40px}
    .config-table th:nth-child(2), .config-table td:nth-child(2){width:180px}
    .config-table th:nth-child(4), .config-table td:nth-child(4){width:90px}
    .config-table th:nth-child(5), .config-table td:nth-child(5){width:120px}
    .config-table th:nth-child(6), .config-table td:nth-child(6){width:110px}
    .config-table th:nth-child(7), .config-table td:nth-child(7){width:110px}
    .config-delete{background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.45);color:#ff9f9f;padding:6px 10px;border-radius:8px;cursor:pointer}
    .config-delete:hover{background:rgba(239,68,68,.22)}
    .config-add-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;margin-top:10px;padding:10px;border-radius:12px;border:1px dashed rgba(120,150,200,.35);background:rgba(16,24,38,.82);color:rgba(206,218,244,.9);font-weight:600;cursor:pointer;transition:border-color .2s ease,background .2s ease,transform .2s ease}
    .config-add-row:hover{border-color:rgba(120,150,200,.55);background:rgba(22,32,50,.88);transform:translateY(-1px)}
    .config-add-row-plus{width:22px;height:22px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(120,150,200,.45);font-size:16px;line-height:1;color:#cfe0ff}
    .config-totals{display:flex;flex-direction:column;gap:8px;margin-top:8px}
    .config-totals-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}
    .config-orders-block{margin-top:14px;padding-top:12px;border-top:1px solid rgba(255,255,255,.08)}
    .config-template-tools{display:flex;justify-content:flex-start;gap:8px;flex-wrap:wrap;margin-top:12px}
    .config-orders-head{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:rgba(196,210,236,.72);margin-bottom:8px}
    .config-orders-list{display:flex;flex-direction:column;gap:8px;max-height:300px;overflow:auto;padding-right:2px}
    .config-orders-empty{padding:12px;border:1px dashed rgba(130,150,200,.24);border-radius:12px;color:var(--muted);text-align:center;font-size:12px;background:rgba(14,20,30,.42)}
    .config-order-link{display:flex;flex-direction:column;gap:6px;width:100%;text-align:left;padding:10px 12px;border-radius:12px;border:1px solid rgba(79,140,255,.18);background:rgba(16,24,38,.74);color:var(--text);cursor:pointer;transition:border-color var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),background-color var(--motion-fast) var(--ease-out)}
    .config-order-link:hover{transform:translateY(-1px);border-color:rgba(79,140,255,.42);background:rgba(20,30,48,.84);box-shadow:0 12px 24px rgba(6,12,24,.28)}
    .config-order-link.is-current{border-color:rgba(52,211,153,.42);box-shadow:0 12px 24px rgba(16,185,129,.14)}
    .config-order-meta{display:flex;align-items:center;justify-content:space-between;gap:8px}
    .config-order-id{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:rgba(190,205,235,.8);font-weight:700}
    .config-order-title{font-size:13px;font-weight:700;color:#eef4ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .config-order-line{font-size:12px;color:rgba(205,216,242,.88);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .config-order-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:rgba(176,190,220,.82)}
    .config-order-current{font-size:11px;color:#93f0c3;font-weight:600}
    .config-kind-card{max-width:min(460px,92vw);width:min(460px,92vw)}
    .config-kind-body{display:flex;flex-direction:column;gap:12px}
    .config-kind-note{font-size:12px;color:var(--muted)}
    .config-kind-actions{display:flex;flex-direction:column;gap:10px}
    .config-kind-btn{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:100%;padding:12px 14px;border-radius:12px;border:1px solid rgba(79,140,255,.22);background:rgba(18,26,40,.78);color:var(--text);cursor:pointer;text-align:left;transition:border-color var(--motion-fast) var(--ease-out),transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-mid) var(--ease-out),background-color var(--motion-fast) var(--ease-out)}
    .config-kind-btn:hover{transform:translateY(-1px);border-color:rgba(79,140,255,.42);background:rgba(20,30,48,.84);box-shadow:0 12px 24px rgba(6,12,24,.28)}
    .config-kind-title{font-size:14px;font-weight:700;color:#eef4ff}
    .config-kind-sub{font-size:12px;line-height:1.45;color:rgba(205,216,242,.84)}
    .config-template-picker-card{max-width:min(980px,96vw);width:min(980px,96vw)}
    .config-template-picker-body{display:flex;flex-direction:column;gap:12px;max-height:min(72vh,720px)}
    .config-template-picker-note{font-size:12px;color:var(--muted)}
    .config-template-picker-list{display:flex;flex-direction:column;gap:8px;overflow:auto;padding-right:4px;min-height:0}
    .config-template-card-btn{gap:10px;padding:12px}
    .config-template-card-head{display:grid;align-items:center;gap:10px;min-width:0}
    .config-template-card-head.has-client-avatar{grid-template-columns:42px minmax(0,1fr) auto}
    .config-template-card-head.no-client-avatar{grid-template-columns:minmax(0,1fr) auto}
    .config-template-avatar{width:42px;height:42px;border-radius:12px;object-fit:cover;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);box-shadow:0 8px 18px rgba(0,0,0,.22)}
    .config-template-client{display:flex;flex-direction:column;gap:4px;min-width:0}
    .config-template-client-top{display:flex;align-items:center;gap:8px;min-width:0}
    .config-template-client-name{font-size:14px;font-weight:700;color:#eef4ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .config-template-client-source{flex:0 0 auto;padding:2px 7px;border-radius:999px;background:rgba(79,140,255,.13);border:1px solid rgba(79,140,255,.24);font-size:10px;font-weight:700;letter-spacing:.04em;color:#cfe0ff}
    .config-template-client-sub{font-size:11px;color:rgba(176,190,220,.82);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .config-template-card-meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px;min-width:max-content}
    .config-template-preview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:6px 10px;padding:10px;border-radius:10px;background:rgba(6,12,22,.24);border:1px solid rgba(255,255,255,.06);min-width:0}
    .config-template-preview-row{display:grid;grid-template-columns:minmax(68px,98px) minmax(0,1fr) max-content;align-items:center;gap:8px;min-width:0;font-size:12px;line-height:1.35}
    .config-template-preview-label{color:rgba(176,190,220,.74);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .config-template-preview-value{color:rgba(238,244,255,.94);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .config-template-preview-meta{color:rgba(176,190,220,.84);white-space:nowrap}
    .config-template-preview-more,.config-template-preview-empty{font-size:12px;color:rgba(176,190,220,.82);padding:2px 0}
    .config-template-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:rgba(176,190,220,.82)}
    .config-template-foot span:last-child{font-weight:700;color:#dce8ff}
    @media (max-width: 720px){
      .config-template-card-head.has-client-avatar{grid-template-columns:38px minmax(0,1fr)}
      .config-template-card-head.no-client-avatar{grid-template-columns:1fr}
      .config-template-card-meta{grid-column:1 / -1;align-items:flex-start;flex-direction:row;justify-content:space-between;min-width:0}
      .config-template-avatar{width:38px;height:38px;border-radius:10px}
      .config-template-preview-grid{grid-template-columns:1fr}
      .config-template-preview-row{grid-template-columns:minmax(64px,90px) minmax(0,1fr)}
      .config-template-preview-meta{grid-column:2;color:rgba(176,190,220,.74)}
    }
    .config-template-delete-text{font-size:13px;line-height:1.55;color:#eef4ff;white-space:pre-wrap;word-break:break-word}
    .orders-kind-switch{margin-bottom:12px;max-width:320px}
    .config-os{display:flex;flex-direction:column;gap:6px;margin-top:12px;max-width:100%}
    .config-os-row{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
    .config-os-row label{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:rgba(196,210,236,.75);min-width:42px}
    .config-os-row label.delivery-label{min-width:74px}
    .config-os-row .input{min-width:0}
    .config-os-row .config-os-name{flex:0 1 260px;max-width:260px}
    .config-os-row .config-delivery{flex:0 1 220px;max-width:220px}
    .config-delivery-cost-wrap{display:flex;align-items:center;gap:10px;min-width:0}
    .config-delivery-cost-wrap.is-hidden{display:none}
    .config-delivery-cost-wrap .delivery-cost-label{min-width:108px}
    .config-os-row .config-delivery-cost{flex:0 1 140px;max-width:140px}
    @media (max-width: 720px){
      .config-os-row{flex-wrap:wrap}
      .config-os-row label.delivery-label{min-width:42px}
      .config-delivery-cost-wrap{width:100%}
      .config-delivery-cost-wrap .delivery-cost-label{min-width:42px}
      .config-os-row .config-os-name,
      .config-os-row .config-delivery,
      .config-os-row .config-delivery-cost{flex:1 1 100%;max-width:none}
    }
    .config-actions-bottom{display:flex;align-items:center;gap:12px;position:absolute;right:16px;bottom:16px;margin:0;pointer-events:none}
    .config-status{color:var(--muted);font-size:12px}
    @media (max-width: 1100px){
      .config-layout{grid-template-columns:1fr}
      .config-summary{position:static}
    }
    .label-preview-card{max-width:520px;width:92vw}
    .label-preview-body{display:flex;flex-direction:column;gap:12px;align-items:center}
    .label-preview-note{font-size:12px;color:var(--muted);text-align:center}
    .label-preview-body img{width:100%;height:auto;border:1px solid var(--border);background:#fff;border-radius:8px}
    .scenario-layout{display:grid;grid-template-columns:220px 220px 1fr;gap:12px;min-height:320px}
    .scenario-col{background:linear-gradient(180deg,rgba(12,26,20,.92),rgba(9,20,16,.9));border:1px solid rgba(34,197,94,.35);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:10px;box-shadow:0 10px 26px rgba(16,185,129,.22)}
    .scenario-col h4{margin:0;font-size:13px;color:rgba(203,214,238,.92);letter-spacing:.04em;text-transform:uppercase}
    .scenario-steps-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
    .scenario-cats,.scenario-list,.scenario-steps{display:flex;flex-direction:column;gap:8px;overflow:auto;max-height:60vh}
    .scenario-chip{padding:8px 10px;border-radius:10px;background:rgba(20,36,28,.78);border:1px solid rgba(34,197,94,.22);cursor:pointer;font-size:13px;color:#d0f5e6;transition:background .2s ease,border-color .2s ease,transform .2s ease}
    .scenario-chip:hover{background:rgba(24,56,42,.85);border-color:rgba(34,197,94,.45);transform:translateY(-1px)}
    .scenario-chip.active{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.55);color:#eafff6;box-shadow:0 12px 24px rgba(16,185,129,.28)}
    .scenario-item{padding:10px;border-radius:12px;background:rgba(14,159,110,.18)!important;border:1px solid rgba(110,231,183,.55)!important;cursor:pointer;transition:background .2s ease,border-color .2s ease,box-shadow .2s ease}
    .scenario-item:hover{background:rgba(14,159,110,.28)!important;border-color:rgba(110,231,183,.75)!important}
    .scenario-item.active{background:rgba(14,159,110,.35)!important;border-color:rgba(110,231,183,.9)!important;box-shadow:0 12px 24px rgba(110,231,183,.28)}
    .scenario-item .title{color:#eafff6}
    .scenario-item .desc{color:rgba(208,246,230,.9)}
    .scenario-item .title{font-weight:600;margin-bottom:4px;color:#e6ecff}
    .scenario-item .desc{font-size:12px;color:rgba(200,210,236,.82)}
    .scenario-step{border:1px solid rgba(34,197,94,.22);background:rgba(16,28,22,.82);padding:10px;border-radius:12px;display:flex;flex-direction:column;gap:8px;transition:border-color .2s ease,box-shadow .2s ease,background .2s ease}
    .scenario-step.done{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.1);box-shadow:0 12px 24px rgba(34,197,94,.18)}
    .scenario-step.failed{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.08);box-shadow:0 12px 24px rgba(239,68,68,.18)}
    .scenario-step-head{display:flex;gap:10px;align-items:flex-start}
    .scenario-step-head input[type="checkbox"]{margin-top:3px;width:16px;height:16px;border-radius:4px;border:1px solid rgba(130,145,180,.4);background:#0f1624}
    .scenario-step-text{font-size:13px;line-height:1.45;color:#e6ecff}
    .scenario-step.done .scenario-step-text{ text-decoration: line-through }
    .scenario-step-actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
    .scenario-btn{border:none;cursor:pointer;padding:6px 12px;border-radius:8px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;display:inline-flex;align-items:center;gap:6px;transition:transform .2s ease,box-shadow .2s ease,background .2s ease}
    .scenario-btn:disabled{opacity:1;filter:none;cursor:not-allowed}
    .scenario-btn:hover{transform:translateY(-1px)}
    .scenario-btn-send{background:#cc4f00;color:#fff;box-shadow:0 10px 20px rgba(204,79,0,.32);border:1px solid #d95f0f}
    .scenario-btn-send:hover{background:#ff6e00}
    .scenario-btn-send:disabled{background:#cc4f00;color:#fff}
    .scenario-btn-insert{background:rgba(79,140,255,.15);color:#bcd5ff;box-shadow:0 5px 10px rgba(79,140,255,.1);border:1px solid rgba(79,140,255,.35)}
    .scenario-btn-insert:hover{background:rgba(79,140,255,.24)}
    .scenario-reset{margin-left:auto;margin-top:-4px;padding:4px 10px;border-radius:8px;border:1px solid rgba(79,140,255,.28);background:rgba(20,28,42,.82);color:#d0daef;font-size:11px;cursor:pointer;letter-spacing:.04em;text-transform:uppercase}
    .scenario-reset:hover{background:rgba(40,56,86,.88);border-color:rgba(79,140,255,.45)}
    .scenario-placeholder{font-size:13px;color:rgba(196,210,236,.75);padding:18px 0}
    /* Quick Replies — match scenarios look */
    .quick-layout{display:grid;grid-template-columns:220px 1fr;gap:12px}
    .quick-cats{display:flex;flex-direction:column;gap:8px;overflow:auto;max-height:60vh;background:transparent;border:none;border-radius:12px;padding:12px;box-shadow:none}
    .quick-cat{padding:8px 10px;border-radius:10px;background:rgba(20,36,28,.78);border:1px solid rgba(34,197,94,.22);cursor:pointer;font-size:13px;color:#d0f5e6;transition:background .2s ease,border-color .2s ease,transform .2s ease}
    .quick-cat:hover{background:rgba(24,56,42,.85);border-color:rgba(34,197,94,.45);transform:translateY(-1px)}
    .quick-cat.active{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.55);color:#eafff6;box-shadow:none}
    .quick-items{display:flex;flex-direction:column;gap:10px;overflow:auto;max-height:60vh;background:transparent;border:none;border-radius:12px;padding:12px;box-shadow:none}
    .quick-item{border:1px solid rgba(82,112,168,.22);background:rgba(18,26,40,.78);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:6px}
    .quick-item .head{display:flex;justify-content:space-between;align-items:center;gap:10px}
    .quick-item .label{font-weight:600;color:#e6ecff;font-size:13px}
    .quick-item .source{font-size:12px;color:rgba(200,210,236,.82)}
    .quick-item .actions{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
    .quick-btn{border:none;padding:6px 12px;border-radius:8px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:transform .2s ease,background .2s ease,box-shadow .2s ease}
    .quick-btn:disabled{opacity:1;filter:none;cursor:not-allowed}
    .quick-btn:hover{transform:translateY(-1px)}
    .quick-btn-insert{background:rgba(79,140,255,.15);color:#bcd5ff;box-shadow:0 5px 10px rgba(79,140,255,.1);border:1px solid rgba(79,140,255,.35)}
    .quick-btn-insert:hover{background:rgba(79,140,255,.24)}
    .quick-btn-send{background:#cc4f00;color:#fff;box-shadow:0 10px 20px rgba(204,79,0,.32);border:1px solid #d95f0f}
    .quick-btn-send:hover{background:#ff6e00}
    .quick-btn-send:disabled{background:#cc4f00;color:#fff}
    .rustdesk-menu{display:flex;flex-direction:column;gap:10px}
    .rustdesk-btn{width:100%;text-align:left;background:rgba(26,36,56,.7);border:1px solid rgba(79,140,255,.22);color:#dce6ff;padding:10px 12px;border-radius:10px;cursor:pointer;font-weight:600;transition:background .2s ease,border-color .2s ease,transform .2s ease}
    .rustdesk-btn:hover{background:rgba(60,90,140,.22);border-color:rgba(79,140,255,.45);transform:translateY(-1px)}
    .action-status{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:10px;border:1px solid rgba(94,148,255,.3);background:rgba(20,30,50,.6);color:#cfe6ff;font-size:12px;font-weight:600}
    .action-status .dot{width:8px;height:8px;border-radius:50%;background:#5eead4;box-shadow:0 0 0 rgba(94,234,212,.4);animation:actionPulse 1.2s ease-in-out infinite}
    @keyframes actionPulse{0%{box-shadow:0 0 0 0 rgba(94,234,212,.45);}70%{box-shadow:0 0 0 8px rgba(94,234,212,0);}100%{box-shadow:0 0 0 0 rgba(94,234,212,0);}}
    .reply-stub{border-left:3px solid #8aa4ff;padding:6px 8px;background:#0f1420;border-radius:8px;margin-bottom:6px;cursor:pointer}
    .reply-head{font-size:11px;color:#b7c7ff;margin-bottom:2px}
    .reply-text{font-size:13px;color:#e6e8ec}
    .reply-bar{display:none;gap:8px;align-items:center;background:#101624;border-top:1px dashed #2a3350;padding:8px 12px}
    .reply-bar .rleft{flex:1;color:#b7c7ff;font-size:13px}
    .forward-bar{display:none;flex-direction:column;gap:8px;align-items:stretch;background:#101624;border-top:1px dashed #2a3350;padding:8px 12px}
    .forward-bar .fwd-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
    .forward-bar .fwd-title{font-size:13px;color:#cfe0ff}
    .forward-bar .fwd-items{display:flex;flex-wrap:wrap;gap:8px}
    .forward-bar .fwd-item{display:flex;align-items:center;gap:8px;padding:4px 8px;border:1px solid rgba(120,150,200,.2);border-radius:10px;background:rgba(16,24,38,.6);max-width:360px}
    .forward-bar .fwd-thumb{width:56px;height:42px;border-radius:8px;background:rgba(20,28,42,.6);display:flex;align-items:center;justify-content:center;overflow:hidden;color:#d3dcff;font-size:18px;flex:0 0 auto}
    .forward-bar .fwd-thumb video{background:#000}
    .forward-bar .fwd-thumb img,.forward-bar .fwd-thumb video{width:100%;height:100%;object-fit:cover;display:block}
    .forward-bar .fwd-body{min-width:0;display:flex;flex-direction:column;gap:2px}
    .forward-bar .fwd-text{font-size:12px;color:#d6e2ff;max-width:290px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .forward-bar .fwd-meta{font-size:11px;color:#8ea0d6}
    .row.editing-target .bubble{border-color:rgba(118,152,255,.65)!important;box-shadow:0 0 0 1px rgba(118,152,255,.55),0 10px 24px rgba(82,120,255,.28)}
    .row.selected .bubble{outline:2px solid rgba(130,105,248,.65); outline-offset:2px}
    .bubble.deleted{border-color:rgba(239,68,68,.6)!important;border-width:3px;box-shadow:0 0 0 3px rgba(239,68,68,.22),0 10px 22px rgba(239,68,68,.16);padding-left:38px;position:relative}
    .bubble.deleted::before{content:"✖";position:absolute;left:14px;top:14px;font-size:14px;font-weight:600;color:#ff6b6b;opacity:.92}
    .edit-bar{display:none;gap:12px;align-items:center;background:rgba(20,26,40,.92);border-bottom:1px dashed rgba(118,152,255,.35);padding:8px 14px;color:#cfd9ff;font-size:13px;justify-content:space-between}
    .edit-bar .hint{display:flex;align-items:center;gap:8px}
    .edit-bar .hint::before{content:"✎";font-size:14px;opacity:.75}
    .edit-bar .actions{display:flex;align-items:center;gap:10px}
    .edit-bar .warn{color:#ffb85c;font-size:12px;opacity:.9}
    .edit-bar button{border:none;border-radius:8px;padding:4px 10px;background:rgba(94,148,255,.18);color:#dbe5ff;cursor:pointer;font-weight:600;font-size:12px;letter-spacing:.03em;transition:background .18s ease, transform .18s ease}
    .edit-bar button:hover{background:rgba(94,148,255,.3);transform:translateY(-1px)}
    /* Bulk bar */
    .bulk-bar{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:14px;padding:0 14px;border:0;background:linear-gradient(180deg,rgba(12,18,28,.9),rgba(9,14,24,.88));min-width:0;min-height:0;height:0;visibility:hidden;opacity:0;transform:translateY(-6px);transition:opacity .2s ease, transform .2s ease, height .2s ease, padding .2s ease,border .2s ease;border-radius:14px;box-shadow:0 12px 28px rgba(0,0,0,.0),0 0 0 1px rgba(94,148,255,.0) inset;overflow:hidden}
    .bulk-bar.open{visibility:visible;opacity:1;transform:none;height:46px;min-height:46px;padding:10px 14px;border:1px solid rgba(94,148,255,.12);box-shadow:0 12px 28px rgba(0,0,0,.35),0 0 0 1px rgba(94,148,255,.08) inset}
    .bulk-bar .cnt{font-weight:600;color:rgba(222,233,255,.9)}
    .bulk-bar .nav{display:flex;align-items:center;justify-content:space-between;gap:16px}
    .bulk-bar .nav-left,.bulk-bar .nav-center,.bulk-bar .nav-right{display:flex;align-items:center;gap:10px}
    .bulk-bar .btnx{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid rgba(120,150,200,.25);border-radius:999px;background:rgba(20,28,42,.55);color:rgba(220,230,255,.9);cursor:pointer;transition:transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease}
    .bulk-bar .btnx:hover{transform:translateY(-1px);background:rgba(28,38,58,.7);box-shadow:0 8px 18px rgba(0,0,0,.3)}
    .bulk-bar .btnx.primary{border-color:rgba(79,140,255,.55);background:rgba(79,140,255,.18);color:#cfe0ff}
    .bulk-bar .btnx.primary:hover{background:rgba(79,140,255,.28)}
    .bulk-bar .btnx.danger{border-color:rgba(255,107,107,.55);background:rgba(255,107,107,.12);color:#ffd4d4}
    .bulk-bar .btnx.danger:hover{background:rgba(255,107,107,.2)}
    .bulk-bar .btnx.neutral{border-color:rgba(120,150,200,.25);background:rgba(22,30,44,.45);color:rgba(220,230,255,.82)}
    .bulk-bar .btnx:disabled{opacity:.6;cursor:default;transform:none;box-shadow:none}

    .latest-order-card{
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      gap:10px 14px;
      align-items:center;
      margin:8px 12px 0;
      padding:10px 12px;
      border:1px solid rgba(94,148,255,.2);
      border-radius:8px;
      background:linear-gradient(180deg,rgba(17,27,46,.94),rgba(12,20,34,.92));
      box-shadow:0 10px 24px rgba(5,10,20,.24), inset 0 1px 0 rgba(210,224,255,.05);
      color:#e9efff;
      min-width:0;
      position:relative;
      z-index:2;
    }
    .latest-order-card[hidden],
    body.ozon-questions-mode .latest-order-card{display:none!important}
    .latest-order-main{min-width:0;display:flex;flex-direction:column;gap:5px}
    .latest-order-head{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}
    .latest-order-title{font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#9fb6e8;white-space:nowrap}
    .latest-order-id{font-size:13px;font-weight:800;color:#f4f8ff;white-space:nowrap}
    .latest-order-date{font-size:12px;color:rgba(196,210,236,.76);white-space:nowrap}
    .latest-order-status{display:inline-flex;align-items:center;min-height:20px;padding:2px 7px;border-radius:7px;border:1px solid rgba(130,150,190,.28);font-size:11px;font-weight:700;color:#dce6ff;background:rgba(120,140,180,.12)}
    .latest-order-status.waiting{border-color:rgba(251,192,45,.42);background:rgba(251,192,45,.15);color:#ffdc78}
    .latest-order-status.inproc{border-color:rgba(34,197,178,.42);background:rgba(34,197,178,.13);color:#7cf0db}
    .latest-order-status.processed{border-color:rgba(248,113,113,.42);background:rgba(248,113,113,.13);color:#ffaaaa}
    .latest-order-summary{display:flex;align-items:center;gap:8px;min-width:0;color:rgba(218,228,248,.9);font-size:13px;line-height:1.35}
    .latest-order-summary-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
    .latest-order-total{flex:0 0 auto;font-weight:800;color:#bff2df;white-space:nowrap}
    .latest-order-action{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height:32px;
      padding:6px 10px;
      border-radius:8px;
      border:1px solid rgba(94,148,255,.38);
      background:rgba(79,140,255,.16);
      color:#dfe9ff;
      font-size:12px;
      font-weight:700;
      cursor:pointer;
      white-space:nowrap;
      transition:background .18s ease,border-color .18s ease,transform .18s ease;
    }
    .latest-order-action:hover{background:rgba(79,140,255,.24);border-color:rgba(116,166,255,.58);transform:translateY(-1px)}
    .latest-order-action:active{transform:none}
    @media (max-width: 720px){
      .latest-order-card{grid-template-columns:1fr;margin:8px 8px 0;padding:9px 10px}
      .latest-order-action{width:100%}
      .latest-order-summary{align-items:flex-start;flex-direction:column;gap:4px}
      .latest-order-summary-text{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
    }

    /* Pinned bar */
    .pin-bar{
      position:relative;z-index:2;
      display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:8px;
      padding:6px 12px;
      background:linear-gradient(180deg, rgba(22,30,46,.94), rgba(16,24,38,.92));
      border-top:1px solid rgba(130,105,248,.32);
      border-bottom:1px solid rgba(130,105,248,.18);
      min-width:0;min-height:0;height:auto;
      visibility:hidden;opacity:0;transform:translateY(-4px);
      transition:opacity .18s ease, transform .18s ease;
      box-shadow:0 8px 16px rgba(5,10,20,.24), inset 0 1px 0 rgba(200,210,240,.05);
      margin-top:0
    }
    .pin-bar.open{visibility:visible;opacity:1;transform:none}
    .pin-bar .cnt{font-weight:600; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; flex:0 0 auto; font-size:12px}
    .pin-bar .nav{display:flex;gap:6px;align-items:center}
    .pin-bar .btnx{padding:4px 8px;border:1px solid var(--border);border-radius:8px;background:#111826;color:var(--text);cursor:pointer}
    .pin-bar .preview{justify-self:stretch;display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;justify-content:space-between}
    .pin-bar .preview img{width:48px;height:48px;object-fit:cover;border-radius:8px;border:1px solid var(--border)}
    .pin-bar .preview .txt{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-2)}
    /* Lightbox */
    .lightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:1000;align-items:center;justify-content:center}
    .lightbox .lb-card{position:relative;width:92vw;height:92vh;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);padding:10px;background:rgba(18,24,36,.96);border-radius:12px;box-shadow:0 16px 34px rgba(0,0,0,.4);border:1px solid rgba(143,124,255,.22);overflow:visible}
    .lightbox .lb-close{position:absolute;top:-12px;right:-12px;border:1px solid rgba(143,124,255,.45);border-radius:999px;background:rgba(15,22,34,.98);color:#e6ecff;cursor:pointer;padding:0;z-index:6;display:flex;align-items:center;justify-content:center;width:30px;height:30px;line-height:1;box-shadow:0 8px 18px rgba(0,0,0,.45);pointer-events:auto}
    .lightbox .lb-close:hover{background:rgba(24,34,52,.98);border-color:rgba(143,124,255,.55)}
    .lightbox .lb-body{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative;z-index:1}
    @media (prefers-reduced-motion: reduce){
      *, *::before, *::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}
    }
