/* public/instagram.css — раздел «📷 Instagram» (И1 + И1-в, 27.10.2026) */
.ig-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ig-head h2 { margin: 0; }
.ig-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ig-chip { background: #eef2ff; color: #1e3a8a; border-radius: 999px; padding: 2px 10px; font-size: .9em; }
.ig-chip-warn { background: #fef3c7; color: #92400e; }
.ig-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; border-bottom: 1px solid #e5e7eb; }
.ig-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px; cursor: pointer; color: inherit; font: inherit; }
.ig-tab.active { border-bottom-color: #2563eb; color: #1d4ed8; font-weight: 600; }
.ig-tab-n { background: #2563eb; color: #fff; border-radius: 999px; padding: 0 6px; font-size: .8em; }
.ig-empty { padding: 18px; border: 1px dashed #d1d5db; border-radius: 8px; }
.ig-plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ig-plan { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ig-day { border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px; min-width: 0; }
.ig-day-h { margin-bottom: 4px; }
.ig-pi { border-left: 3px solid #93c5fd; padding: 3px 6px; margin: 4px 0; font-size: .92em; overflow-wrap: anywhere; }
.ig-pi-news { border-left-color: #34d399; }
.ig-pi-product { border-left-color: #fbbf24; }
.ig-pi-reel, .ig-pi-carousel, .ig-pi-image { border-left-color: #a78bfa; }
.ig-pi-planned { opacity: .7; border-left-style: dashed; }
.ig-pi-t { font-weight: 600; }
.ig-pi-k { font-size: .85em; color: #6b7280; }
.ig-cards { display: flex; flex-direction: column; gap: 12px; }
.ig-card { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; }
.ig-card-over { border-color: #f59e0b; }
.ig-card-media { min-width: 0; }
.ig-video { width: 100%; max-height: 460px; background: #000; border-radius: 8px; }
.ig-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ig-thumbs img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; border: 1px solid #e5e7eb; }
.ig-card-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ig-card-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ig-card-h h3 { margin: 0; overflow-wrap: anywhere; }
.ig-kind { background: #ede9fe; color: #5b21b6; border-radius: 4px; padding: 0 6px; font-size: .85em; }
.ig-badge { background: #e5e7eb; border-radius: 4px; padding: 0 6px; font-size: .85em; }
.ig-badge.ig-ok { background: #d1fae5; color: #065f46; }
.ig-badge.ig-warn { background: #fef3c7; color: #92400e; }
.ig-cap { width: 100%; box-sizing: border-box; font: inherit; }
.ig-cap-l { display: flex; align-items: center; gap: 8px; }
.ig-tags { color: #1d4ed8; overflow-wrap: anywhere; }
.ig-facts { margin: 0; padding-left: 18px; }
.ig-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ig-files a { overflow-wrap: anywhere; }
.ig-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ig-link { flex: 1 1 240px; min-width: 0; }
.ig-home-line { margin: 6px 0 12px; }
.igm-team-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
@media (max-width: 900px) {
  .ig-plan { grid-template-columns: minmax(0, 1fr); }
  .ig-card { grid-template-columns: minmax(0, 1fr); }
}
html[data-theme="dark"] .ig-chip { background: #1e3a8a; color: #dbeafe; }
html[data-theme="dark"] .ig-day, html[data-theme="dark"] .ig-card { border-color: #374151; }
html[data-theme="dark"] .ig-badge { background: #374151; }

/* И1-с: «📝 Сценарии» */
.igs-week { margin: 16px 0 6px; font-size: 15px; }
.igs-slides { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; max-width: 100%; }
.igs-slides img, .igs-slides video { flex: 0 0 auto; width: 160px; max-height: 280px; object-fit: cover; border-radius: 6px; scroll-snap-align: start; }
.igs-sb td { vertical-align: top; font-size: 13px; }
.igs-sb td:first-child { white-space: nowrap; }
.igs-tags { width: 100%; box-sizing: border-box; }
.igs-hook { margin: 6px 0; }
.igs-pre { white-space: pre-wrap; font-size: 13px; vertical-align: top; }
.igs-cmp { margin-top: 8px; }
.igs-log ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
/* 30.10.2026: «🗂 Темы» и «✨ Сценарий ИИ» в «📝 Сценариях» */
.igs-tools { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.igs-plate { border: 1px solid var(--border, #d8dde6); border-left-width: 4px; border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.igs-plate ul { margin: 4px 0 0 18px; padding: 0; }
.igs-plate-warn { border-left-color: #d97706; background: rgba(217, 119, 6, .08); }
.igs-plate-bad { border-left-color: #dc2626; background: rgba(220, 38, 38, .07); }
.igs-plate-grey { border-left-color: #94a3b8; background: rgba(148, 163, 184, .12); }
.igs-modal-box { max-width: 860px; width: 100%; max-height: 92vh; overflow: auto; }
/* 04.11.2026 (№76): окно поста о товаре — шесть кнопок не помещаются в одну строку, переносятся внутри окна */
#igp-modal .modal-actions { flex-wrap: wrap; z-index: 1; }
.igt-table td { vertical-align: top; }
.igt-table tr.igt-season td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.igt-acts { white-space: nowrap; width: 1%; }
.igt-acts > button { display: block; width: 100%; margin: 0 0 6px; }
.igt-stale { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 6px; background: rgba(148, 163, 184, .2); color: var(--muted, #64748b); font-size: 12px; }
.igt-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.igt-form label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.igt-form .igt-wide { grid-column: 1 / -1; }
.igt-form .igt-chk { flex-direction: row; align-items: center; gap: 8px; }
.igt-form input, .igt-form select, .igt-form textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 640px) {
  .igt-form { grid-template-columns: minmax(0, 1fr); }
  .igs-tools { margin-left: 0; width: 100%; }
  .igt-acts { white-space: normal; }
}

/* 2026-11-01a (И4): плитки статистики */
.ig-stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.ig-stat-tiles > div { border: 1px solid var(--border, #d8e1ea); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ig-stat-tiles b { font-size: 20px; }
.ig-stat-tiles span { font-size: 12px; color: var(--muted, #5b6b7a); }

/* 2026-11-01a (№58): текст комментария или сообщения */
.igc-text { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--g-accent, #C2410C); background: var(--g-surface-2, rgba(0,0,0,.03)); border-radius: 6px; white-space: pre-wrap; }

/* 02.11.2026 (КИ-1): таблица кадров сценария — по ширине карточки, текст переносится (общее правило таблиц даёт min-width 620 px);
   если всё же не поместится — листается внутри своего блока, а не вся страница. */
.ig-card-main .table-wrap { max-width: 100%; overflow-x: auto; }
table.products.igs-sb { min-width: 0; width: 100%; }
table.products.igs-sb :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
/* 02.11.2026 (КИ-3): тёмная тема — тёмно-синий на тёмном был 2,16:1 */
html[data-theme="dark"] .ig-tab.active { color: #93C5FD; border-bottom-color: #93C5FD; }
html[data-theme="dark"] .ig-tags { color: #93C5FD; }
