/* AISeller UI polish (2026-09-14, v7): VK in the unified queue. */

/* 2026-09-14 owner live clarity:
   one honest loading/error state for the owner dashboard instead of nine empty cards,
   plus mobile safety for the same block. */
.owner-live-state{display:flex;gap:16px;align-items:flex-start;padding:22px;border-radius:18px;background:linear-gradient(145deg,#fff,#f7fbff)}
.owner-live-state-icon{width:40px;height:40px;flex:0 0 40px;border-radius:13px;display:flex;align-items:center;justify-content:center;background:rgba(14,147,132,.12);color:#0e9384;font-size:19px;font-weight:900}
.owner-live-state-copy{display:block;min-width:0}
.owner-live-state-copy b{display:block;font-size:16px;line-height:1.3;margin-bottom:4px}
.owner-live-state-copy span{display:block;color:#475569;font-size:13px;line-height:1.55}
.owner-live-state-copy small{display:block;margin-top:7px;color:#64748b;font-size:12px;line-height:1.45}
.owner-live-state-error .owner-live-state-icon{background:rgba(220,38,38,.12);color:#dc2626}
.owner-live-state-actions{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
@media(max-width:900px){
  .owner-live-state{flex-wrap:wrap;padding:18px;gap:12px}
  .owner-live-state-actions{margin-left:0;width:100%}
  .owner-live-state-actions .ghost-button{width:100%}
}
/* Defensive: the older per-widget state block must never overlap its own button on phones. */
@media(max-width:760px){
  .dashboard-live-state{grid-template-columns:1fr;max-width:none}
  .dashboard-live-state button{justify-self:stretch;width:100%}
}

/* 2026-09-14 stage 2:
   honest empty-period notice, verified channel status note, demo scenario banner. */
.owner-live-notice{display:flex;gap:16px;align-items:flex-start;padding:18px 22px;border-radius:18px;background:linear-gradient(145deg,#fff8ef,#fffdf9);border:1px solid #f5d9b0;margin-bottom:14px}
.owner-live-notice .owner-live-state-icon{background:rgba(217,119,6,.14);color:#b45309}
.owner-live-notice .owner-live-state-copy b{font-size:15px}
.channel-scenario-note{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:14px 18px;margin:12px 0 16px;border-radius:16px;background:linear-gradient(145deg,#eef6ff,#f7fbff);border:1px solid #cfe3ff}
.channel-scenario-note b{font-size:13px;font-weight:900;color:#1d4ed8;text-transform:uppercase;letter-spacing:.04em}
.channel-scenario-note span{flex:1 1 320px;color:#475569;font-size:12.5px;line-height:1.5}
.channel-scenario-note.hidden{display:none}
@media(max-width:760px){
  .owner-live-notice,.channel-scenario-note{flex-direction:column;align-items:stretch;padding:16px}
  .owner-live-notice .owner-live-state-actions,.owner-live-notice .ghost-button{width:100%}
}

/* 2026-09-14 stage 5: queue filters with live counts. */
.queue-filter-row{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0 11px}
.queue-filter{border-radius:999px!important;font-size:12px!important;font-weight:800!important;padding:6px 11px!important;cursor:pointer}
.queue-filter:not(.ghost-button){background:#1d4ed8!important;border:1px solid #1d4ed8!important;color:#fff!important}
.queue-filter.ghost-button{background:#fff!important;border:1px solid #d7e3f1!important;color:#475569!important}
.queue-filter b{margin-left:5px;font-weight:900;opacity:.85}
.queue-filter.is-empty{opacity:.55}
@media(max-width:760px){
  .queue-filter-row{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .queue-filter{width:100%;text-align:center}
}

/* 2026-09-14 stage 6: channel strip, floating helper and dialog timestamps. */
.owner-channel-strip{grid-template-columns:repeat(auto-fit,minmax(232px,1fr))!important}
.owner-channel{grid-template-columns:38px minmax(0,1fr) auto!important;column-gap:10px!important;row-gap:6px!important;overflow:hidden!important;align-items:center!important}
.owner-channel>div{min-width:0}
.owner-channel>div b,.owner-channel>div small{overflow-wrap:anywhere;word-break:break-word}
.owner-channel .badge{position:static!important;white-space:nowrap!important;justify-self:end}
@media(max-width:1180px){
  .owner-channel{grid-template-columns:38px minmax(0,1fr)!important}
  .owner-channel .badge{grid-column:2;justify-self:start}
}
/* The floating helper pill must never sit on top of the operator reply field. */
.floating-chat-widget{bottom:92px!important;z-index:9000!important}
@media(max-width:900px){.floating-chat-widget{bottom:92px!important;right:12px!important}}
/* Dialog metadata inside a bubble stays quiet and readable. */
.message small{color:#64748b!important;font-size:11px!important;font-weight:700!important;letter-spacing:0}
.message b{font-size:12px!important;letter-spacing:.01em;text-transform:none!important}

/* 2026-09-14 stage 7: final layout polish for the owner console.
   1) the channel badge always sits under the channel text — never on top of it
   2) the demo helper pill is hidden inside a real owner cabinet: it covered the reply button */
.owner-channel{grid-template-columns:38px minmax(0,1fr)!important;row-gap:6px!important;align-items:start!important}
.owner-channel .owner-channel-logo{align-self:center}
.owner-channel .badge{grid-column:2;justify-self:start;position:static!important;white-space:nowrap!important;margin-top:2px}
.owner-channel-strip{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important}
body[data-tenant-mode="production"] .floating-chat-widget{display:none!important}
body.owner-session .floating-chat-widget{display:none!important}

/* 2026-09-14: демонстрационный SEO-экран */
.seo-demo-note{display:flex;gap:14px;align-items:flex-start;padding:18px 22px;margin-bottom:14px;border-radius:18px;background:linear-gradient(145deg,#eef6ff,#f8fbff);border:1px solid #cfe3ff}
.seo-demo-note-icon{width:36px;height:36px;flex:0 0 36px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:rgba(37,99,235,.12);color:#1d4ed8;font-weight:900}
.seo-demo-note b{display:block;font-size:15px;margin-bottom:4px}
.seo-demo-note span{display:block;color:#475569;font-size:13px;line-height:1.55}
.seo-demo-steps{margin:6px 0 0;padding-left:20px;color:#334155;font-size:13.5px;line-height:1.7}
.seo-demo-steps li{margin-bottom:6px}

/* 2026-09-14: календарь публикаций в SEO-контуре владельца */
.publication-calendar .pub-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:4px 0 14px}
.pub-day{background:#f8fafc;border:1px solid #e5edf6;border-radius:14px;padding:10px 8px;min-height:76px;display:flex;flex-direction:column;gap:6px}
.pub-day b{font-size:15px;color:#172033}
.pub-day span{font-size:11px;font-weight:800;color:#7b8794;text-transform:uppercase;letter-spacing:.04em}
.pub-day.has-plan{background:#eef6ff;border-color:#cfe3ff}
.pub-day.is-today{box-shadow:inset 0 0 0 2px #1d4ed8}
.pub-chip{display:inline-block;font-size:10.5px;font-weight:900;font-style:normal;padding:4px 7px;border-radius:999px;white-space:nowrap}
.pub-chip.telegram{background:#e0f2fe;color:#0369a1}
.pub-chip.blog{background:#ede9fe;color:#5b21b6}
.pub-chip.max{background:#fef3c7;color:#92400e}
.pub-legend{display:flex;flex-wrap:wrap;gap:10px 18px;margin-top:4px}
.pub-legend-item{display:flex;align-items:center;gap:7px;color:#475569;font-size:12.5px}
.pub-source{margin:10px 0 0;color:#64748b;font-size:12px;line-height:1.5}
@media(max-width:900px){
  .publication-calendar .pub-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .pub-day{min-height:64px;padding:8px 6px}
}

/* 2026-09-14 stage 11: единый список диалогов, период, последние публикации. */
.unified-list{display:grid!important;gap:8px!important}
.unified-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px 10px;align-items:center;width:100%;text-align:left;background:#fff;border:1px solid #e5edf6;border-radius:14px;padding:10px 12px;cursor:pointer}
.unified-row:hover{border-color:#cfe3ff;box-shadow:0 6px 18px rgba(29,78,216,.08)}
.unified-row-channel{grid-row:span 2;align-self:center;background:#eef6ff;color:#1d4ed8;border-radius:999px;font-size:10.5px;font-weight:900;padding:5px 8px;white-space:nowrap}
.unified-row.channel-max .unified-row-channel{background:#fef3c7;color:#92400e}
.unified-row b{font-size:13.5px;color:#172033;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.unified-row p{margin:0;color:#475569;font-size:12.5px;line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.unified-row-status{grid-column:2/4;font-size:11px;font-weight:800;font-style:normal}
.unified-row-status.attention{color:#b45309}
.unified-row-status.manual{color:#1d4ed8}
.unified-row-status.closed{color:#64748b}
.unified-row-status.active{color:#15803d}
.unified-more{margin-top:10px;width:100%}
.inbox-period-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0 12px}
.inbox-period-row>span{color:#475569;font-size:12.5px;font-weight:700}
.inbox-period-row>b{font-size:15px;color:#172033}
.inbox-period-row>small{color:#7b8794;font-size:12px}
.max-detail .max-messages{display:grid;gap:8px;margin:10px 0}
.dashboard-unified-list{display:grid;gap:7px;max-height:420px;overflow:auto}
.dashboard-unified-list .unified-row{padding:9px 11px}
.dashboard-unified-foot{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin-top:10px}
.dashboard-unified-foot span{color:#64748b;font-size:12px;font-weight:700}
.dashboard-news-list{display:grid;gap:6px}
.dashboard-news-row{display:grid;gap:2px;padding:9px 11px;border:1px solid #e5edf6;border-radius:12px;text-decoration:none;color:#172033}
.dashboard-news-row:hover{border-color:#cfe3ff}
.dashboard-news-row b{font-size:12.5px;word-break:break-all}
.dashboard-news-row span{color:#64748b;font-size:11.5px}
.dashboard-news-plan{display:grid;gap:4px;margin-top:10px;padding-top:10px;border-top:1px dashed #dbe6f2}
.dashboard-news-plan b{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#1d4ed8}
.dashboard-news-plan span{color:#475569;font-size:12px}
@media(max-width:760px){
  .unified-row{grid-template-columns:minmax(0,1fr);padding:10px}
  .unified-row-channel{grid-row:auto;justify-self:start}
  .unified-row-status{grid-column:1}
  .dashboard-unified-list{max-height:none}
}

/* 2026-09-14: MAX-переписка в кабинете (ответ оператора и его состояние) */
.unified-row-status.answered{color:#0f766e}
.message.owner.failed{border-color:#fecaca!important;background:#fef2f2!important}
.max-messages{display:grid;gap:10px}
.max-messages .message small{color:#64748b!important;font-size:11px!important;font-weight:700!important}

/* 2026-09-14: сворачиваемые панели (сайт-чат сводка) */
.collapsible-panel{padding:0!important;overflow:hidden}
.collapsible-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;width:100%!important;padding:16px 20px!important;background:#fff!important;border:0!important;cursor:pointer!important;text-align:left!important}
.collapsible-head:hover{background:#f8fbff!important}
.collapsible-title{display:grid!important;gap:3px!important}
.collapsible-title b{font-size:16px!important;color:#172033!important}
.collapsible-title small{color:#64748b!important;font-size:12px!important;font-weight:700!important}
.collapsible-side{display:flex!important;align-items:center!important;gap:10px!important}
.collapsible-side strong{font-size:20px!important;line-height:1!important;color:#1d4ed8!important}
.collapsible-panel.collapsed .collapsible-body{display:none!important}
.collapsible-panel.open .collapsible-body{padding:0 20px 18px!important;display:block!important}
@media(max-width:760px){
  .collapsible-head{padding:14px!important}
  .collapsible-panel.open .collapsible-body{padding:0 14px 14px!important}
}

/* 2026-09-14: ВКонтакте в общей очереди */
.unified-row.channel-vk .unified-row-channel{background:#eaf3ff;color:#0077ff}
.vk-detail .message small{color:#64748b!important}
