:root {
  color-scheme:light;
  --nav:#17233a;
  --blue:#2f6fed;
  --blue-soft:#edf3ff;
  --bg:#f4f7fb;
  --panel:#fff;
  --line:#dce3ee;
  --text:#172033;
  --muted:#68778f;
  --success:#168554;
  --warn:#b76b00;
  --danger:#c73d4b;
  --radius:14px;
  --shadow:0 8px 28px rgba(23,32,51,.07);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif
}

* {
  box-sizing:border-box
}

html,body {
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text)
}

body {
  font-size:14px;
  line-height:1.45
}

a {
  color:var(--blue);
  text-decoration:none
}

a:hover {
  text-decoration:underline
}

img {
  max-width:100%;
  object-fit:cover
}

.app-shell {
  display:grid;
  grid-template-columns:244px minmax(0,1fr);
  min-height:100vh
}

.sidebar {
  position:sticky;
  top:0;
  height:100vh;
  padding:20px 14px;
  background:var(--nav);
  color:#fff;
  display:flex;
  flex-direction:column;
  z-index:20
}

.brand {
  display:flex;
  align-items:center;
  gap:11px;
  padding:0 8px 20px;
  color:#fff;
  font-weight:750;
  font-size:16px
}

.brand:hover {
  text-decoration:none
}

.brand-mark {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:10px;
  background:var(--blue);
  font-size:17px
}

.side-nav {
  display:flex;
  flex-direction:column;
  gap:4px;
  overflow:auto
}

.nav-caption {
  padding:17px 12px 5px;
  color:#7f90ad;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em
}

.nav-item {
  display:flex;
  align-items:center;
  gap:11px;
  min-height:42px;
  padding:0 12px;
  border-radius:9px;
  color:#bdc9dc;
  font-weight:550
}

.nav-item span {
  width:18px;
  text-align:center
}

.nav-item:hover {
  background:#202f4a;
  color:#fff;
  text-decoration:none
}

.nav-item.active {
  background:#2b3d60;
  color:#fff
}

.sidebar-footer {
  margin-top:auto;
  padding:16px 10px 0;
  border-top:1px solid #2c3c57;
  color:#adbad0;
  font-size:12px
}

.status-dot {
  display:inline-block;
  width:8px;
  height:8px;
  margin-right:7px;
  border-radius:50%;
  background:#39c47f
}

.logout {
  padding:9px 0;
  margin-top:7px;
  border:0;
  background:none;
  color:#d3dbea;
  text-align:left
}

.app-body {
  min-width:0
}

.topbar {
  height:70px;
  padding:0 28px;
  border-bottom:1px solid var(--line);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px
}

.topbar strong {
  display:block
}

.topbar-subtitle {
  display:block;
  color:var(--muted);
  font-size:11px
}

.mobile-menu {
  display:none;
  border:0;
  background:none;
  font-size:22px
}

.content {
  max-width:1440px;
  margin:0 auto;
  padding:28px
}

h1 {
  margin:0;
  font-size:28px;
  letter-spacing:-.03em
}

h2 {
  margin:0 0 14px;
  font-size:17px
}

h3 {
  margin:0 0 6px;
  font-size:15px
}

.page-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:22px
}

.page-head p,.muted {
  color:var(--muted)
}

.page-head p {
  margin:5px 0 0
}

.button,button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:34px;
  padding:0 11px;
  border:1px solid #cbd5e3;
  border-radius:9px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-weight:650;
  cursor:pointer
}

.button:hover,button:hover {
  border-color:#9eb0c8;
  text-decoration:none
}

.button.primary,button.primary {
  border-color:var(--blue);
  background:var(--blue);
  color:#fff
}

.button.danger,button.danger {
  border-color:#f1c4c9;
  color:var(--danger)
}

.button.compact {
  min-height:32px;
  padding:0 10px
}

.button:disabled,button:disabled {
  opacity:.5;
  cursor:not-allowed
}

.actions {
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap
}

.panel,section>article,main>section {
  padding:20px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--panel);
  box-shadow:var(--shadow);
  margin-bottom:18px
}

.panel-flat {
  padding:18px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff
}

.stats {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px
}

.stat {
  padding:17px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff
}

.stat-label {
  color:var(--muted);
  font-size:12px
}

.stat-value {
  display:block;
  margin-top:5px;
  font-size:26px;
  font-weight:750
}

.grid-2 {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px
}

.grid-3 {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:15px
}

.card-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  gap:15px
}

.card {
  padding:17px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff
}

.card.selected {
  outline:2px solid var(--blue)
}

.card-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px
}

.badge {
  display:inline-flex;
  padding:4px 8px;
  border-radius:99px;
  background:var(--blue-soft);
  color:var(--blue);
  font-size:11px;
  font-weight:700
}

.badge.ok {
  background:#e7f7ef;
  color:var(--success)
}

.badge.error {
  background:#fdecee;
  color:var(--danger)
}

.badge.wait {
  background:#fff4de;
  color:var(--warn)
}

form {
  margin:0
}

label {
  display:grid;
  gap:6px;
  margin-bottom:13px;
  font-weight:600
}

input,textarea,select {
  width:100%;
  min-height:42px;
  padding:9px 11px;
  border:1px solid #cbd5e3;
  border-radius:8px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-weight:400
}

textarea {
  resize:vertical
}

input:focus,textarea:focus,select:focus {
  outline:3px solid #dbe7ff;
  border-color:var(--blue)
}

input[type=checkbox],input[type=radio] {
  width:18px;
  min-height:18px;
  margin:0
}

fieldset {
  margin:0 0 14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px
}

fieldset label {
  display:flex;
  align-items:center;
  gap:8px;
  margin:7px 0
}

legend {
  padding:0 6px;
  font-weight:700
}

[role=alert] {
  padding:11px 13px;
  border:1px solid #f0c4c9;
  border-radius:9px;
  background:#fff1f2;
  color:#9e2835
}

.notice {
  padding:11px 13px;
  border-radius:9px;
  background:var(--blue-soft);
  color:#38537e
}

.progress {
  height:8px;
  border-radius:10px;
  background:#e6ebf3;
  overflow:hidden
}

.progress>span {
  display:block;
  height:100%;
  background:var(--blue)
}

ul.clean {
  padding:0;
  margin:0;
  list-style:none
}

.list-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 0;
  border-bottom:1px solid #edf0f5
}

.list-row:last-child {
  border:0
}

.avatar {
  width:42px;
  height:42px;
  border-radius:10px;
  background:#e7edf6
}

.media-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:14px
}

.media-card {
  position:relative;
  margin:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  overflow:hidden
}

.media-card>img {
  display:block;
  width:100%;
  aspect-ratio:4/3;
  background:#e6ebef
}

.media-card figcaption,.media-meta {
  padding:11px
}

.media-card form {
  padding:0 11px 11px
}

.media-card .badge {
  position:absolute;
  top:9px;
  right:9px
}

.thumb-row {
  display:flex;
  gap:8px;
  overflow:auto
}

.thumb-row img {
  width:96px;
  height:72px;
  border-radius:8px
}

.workflow {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px
}

.workflow-step {
  padding:12px;
  border-radius:10px;
  background:var(--blue-soft)
}

.workflow-step strong {
  display:block;
  color:var(--blue);
  font-size:12px
}

.workflow-step span {
  font-size:11px
}

.sticky-actions {
  position:sticky;
  bottom:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  margin-top:15px;
  border-radius:11px;
  background:var(--nav);
  color:#fff;
  box-shadow:0 12px 32px rgba(0,0,0,.2)
}

table {
  width:100%;
  border-collapse:collapse
}

th,td {
  padding:11px;
  border-bottom:1px solid var(--line);
  text-align:left
}

th {
  color:var(--muted);
  font-size:11px;
  text-transform:uppercase
}

.auth-layout {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:20px;
  background:linear-gradient(140deg,#142039,#263b62)
}

.auth-card {
  width:min(420px,100%);
  padding:28px;
  border-radius:16px;
  background:#fff;
  box-shadow:0 25px 70px rgba(0,0,0,.25)
}

.auth-brand {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:22px;
  font-size:18px;
  font-weight:750
}

@media(max-width:900px) {
  .app-shell {
    grid-template-columns:1fr
  }

  .sidebar {
    position:fixed;
    left:-260px;
    width:244px;
    transition:left .2s
  }

  .menu-open .sidebar {
    left:0
  }

  .mobile-menu {
    display:block
  }

  .topbar {
    justify-content:flex-start
  }

  .topbar .button {
    margin-left:auto
  }

  .content {
    padding:20px
  }

  .grid-2,.stats {
    grid-template-columns:1fr
  }

  .workflow {
    grid-template-columns:repeat(2,1fr)
  }

}

@media(max-width:560px) {
  .content {
    padding:15px
  }

  .topbar {
    padding:0 15px
  }

  .topbar-subtitle {
    display:none
  }

  .topbar>.button {
    display:none
  }

  .page-head {
    display:block
  }

  .page-head .actions {
    margin-top:12px
  }

  .grid-3,.media-grid,.workflow {
    grid-template-columns:1fr
  }

  .sticky-actions {
    align-items:stretch;
    flex-direction:column
  }

}

.table-scroll {
  overflow-x:auto
}

.empty-state {
  padding:48px 20px;
  text-align:center
}

.empty-state .button {
  margin-top:8px
}

.prompt-profile-list {
  display:grid;
  gap:12px
}

.prompt-profile-list details[data-disabled="true"] {
  opacity:.72
}

.prompt-profile-list summary {
  cursor:pointer;
  list-style:none
}

.prompt-profile-list details[open] summary {
  margin-bottom:18px
}

.prompt-profile-list form+form {
  margin-top:10px
}

.error-detail {
  color:var(--danger);
  font-size:12px
}

.publication-success {
  padding:14px 16px;
  margin:16px 0;
  border:1px solid #a9ddc4;
  border-left:5px solid var(--success);
  border-radius:10px;
  background:#eaf8f1;
  color:#155d40
}

.table-note {
  color:var(--muted);
  font-size:12px
}

.list-filters {
  margin-bottom:16px
}

.draft-excerpt {
  display:inline-block;
  max-width:320px;
  margin-top:5px;
  color:var(--muted);
  font-size:12px
}

.row-actions {
  display:flex;
  gap:7px;
  flex-wrap:wrap
}

.lifecycle-actions {
  margin:14px 0 18px
}

.draft-readonly-text {
  max-width:82ch;
  white-space:pre-line;
  font-size:14px;
  line-height:1.5
}

.source-post-card {
  padding:0;
  margin:22px 0 30px;
  border:2px solid #cbd7e8;
  border-radius:16px;
  background:#fff;
  box-shadow:0 10px 30px rgba(23,32,51,.09);
  overflow:hidden
}

.source-post-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px 18px;
  border-bottom:2px solid #dce5f2;
  background:linear-gradient(90deg,#eef4ff,#f8fbff)
}

.source-post-header h2 {
  margin:2px 0 0;
  font-size:18px
}

.source-post-kicker {
  color:var(--blue);
  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase
}

.source-post-card>.media-grid {
  padding:18px;
  background:#f8fafd
}

.source-post-text {
  padding:14px 18px;
  border-top:1px solid var(--line)
}

.source-post-text summary {
  color:var(--blue);
  cursor:pointer;
  font-weight:700
}

@media(max-width:700px) {
  .source-post-header {
    align-items:flex-start;
    flex-direction:column
  }
}

.image-preview-trigger {
  cursor:zoom-in;
}

.image-preview-trigger:focus-visible {
  outline:3px solid var(--blue);
  outline-offset:-3px;
}

.image-lightbox {
  width:min(96vw,1400px);
  max-width:none;
  height:min(94vh,1000px);
  max-height:none;
  padding:0;
  border:0;
  border-radius:14px;
  background:#101827;
  color:#fff;
  box-shadow:0 24px 80px rgba(0,0,0,.5);
}

.image-lightbox::backdrop {
  background:rgba(5,10,20,.82);
  backdrop-filter:blur(3px);
}

.image-lightbox-panel {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  height:100%;
}

.image-lightbox-head,
.image-lightbox-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 16px;
}

.image-lightbox-head {
  border-bottom:1px solid rgba(255,255,255,.14);
}

.image-lightbox-footer {
  border-top:1px solid rgba(255,255,255,.14);
  color:#c7d0df;
  font-size:12px;
}

.image-lightbox-close {
  width:40px;
  min-height:40px;
  padding:0;
  border-color:rgba(255,255,255,.25);
  background:rgba(255,255,255,.1);
  color:#fff;
  font-size:26px;
  line-height:1;
}

.image-lightbox-stage {
  display:grid;
  place-items:center;
  min-height:0;
  padding:16px;
  overflow:auto;
}

.image-lightbox-stage img {
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  max-height:100%;
  object-fit:contain;
  background:#0a101b;
}

@media(max-width:560px) {
  .image-lightbox {
    width:100vw;
    height:100vh;
    max-height:100vh;
    border-radius:0;
  }

  .image-lightbox-footer {
    align-items:stretch;
    flex-direction:column;
  }
}

.library-filters,
.library-pagination {
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.library-grid {
  margin-bottom:18px;
}

.library-card {
  display:block;
  cursor:default;
}

.library-card.selected {
  outline:2px solid var(--success);
}

.library-select {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:9px 11px;
  font-weight:650;
}

.library-image-link {
  display:block;
  cursor:zoom-in;
}

.library-image-link img {
  display:block;
  width:100%;
  aspect-ratio:4/3;
  background:#e6ebef;
}

.library-card .media-meta {
  display:flex;
  align-items:flex-start;
  gap:7px;
  flex-wrap:wrap;
}

.library-card .media-meta strong,
.library-card .media-meta small {
  flex-basis:100%;
}

.library-card .media-meta small {
  color:var(--muted);
}

.library-actions .actions {
  justify-content:flex-end;
}

.library-pagination {
  justify-content:center;
  margin-top:20px;
}

@media(max-width:700px) {
  .library-actions .actions,
  .library-actions button {
    width:100%;
  }
}


.competitor-avatar {
  width:64px;
  height:64px;
  border-radius:16px;
}

.post-insight-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,2fr);
  gap:18px;
  padding:18px;
  border-top:1px solid var(--line);
}

@media(max-width:700px) {
  .post-insight-grid {
    grid-template-columns:1fr;
  }
}


.style-choice-list {
  display: grid;
  gap: .55rem;
  margin-top: .75rem;
  min-width: min(32rem, 75vw);
}
.style-choice-list label {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 620px));
  justify-content:center;
  align-items:start;
  gap: 1rem;
}
.variant-grid .source-post-card{margin:0}
.draft-compact-preview{display:-webkit-box;max-height:21em;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:14;white-space:pre-line;font-size:14px;line-height:1.5;color:#172033}
.draft-compact-preview.expanded{display:block;max-height:none;-webkit-line-clamp:unset}
.draft-expand-button{margin-top:12px;padding:10px 0 0;border:0;border-top:1px solid var(--line);background:none;color:var(--blue);font-family:inherit;font-size:13px;font-weight:700;cursor:pointer;text-align:left;width:100%}
.draft-full-text{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.draft-full-text>summary{cursor:pointer;color:var(--blue);font-size:13px;font-weight:700}
.draft-full-text[open] .draft-readonly-text{margin-top:10px}
.media-zoom-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.media-zoom-button img {
  display: block;
  width: 100%;
}
.image-lightbox {
  width: min(94vw, 1100px);
  max-height: 94vh;
  padding: 3rem 1rem 1rem;
  border: 0;
  border-radius: 1rem;
  background: #111827;
}
.image-lightbox::backdrop {
  background: rgba(15, 23, 42, .86);
}
.image-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 4rem);
  margin: auto;
  object-fit: contain;
}
.image-lightbox-close {
  position: absolute;
  top: .6rem;
  right: .8rem;
  border: 0;
  background: transparent;
  color: white;
  font-size: 2rem;
  line-height: 1;
}
/* Компактные горизонтальные фильтры аналитики и кейсов */
.compact-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.compact-filter-bar select {
  width: auto;
  min-width: 11rem;
  flex: 1 1 11rem;
  margin: 0;
}
.compact-filter-bar .button,
.compact-filter-bar button {
  flex: 0 0 auto;
  margin: 0;
}
@media (max-width: 680px) {
  .compact-filter-bar {
    align-items: stretch;
  }
  .compact-filter-bar select,
  .compact-filter-bar .button,
  .compact-filter-bar button {
    width: 100%;
  }
}
/* Банк идей: источник слева, связанные идеи справа */
.manual-idea-entry {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}
.manual-idea-entry > summary,
.standalone-ideas > summary {
  cursor: pointer;
  font-weight: 700;
}
.manual-idea-entry form {
  margin-top: 1rem;
}
.idea-source-feed {
  display: grid;
  gap: 1.25rem;
}
.idea-source-card {
  scroll-margin-top: 1rem;
}
.idea-source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .95fr);
  gap: 1.25rem;
  align-items: start;
}
.idea-source-main {
  min-width: 0;
}
.idea-source-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: .9rem;
  background: var(--surface-soft, #f8fafc);
}
.idea-source-panel .card-head {
  margin-bottom: .75rem;
}
.idea-compact-card {
  margin-bottom: .65rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--surface);
  overflow: hidden;
}
.idea-compact-card > summary {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  padding: .85rem;
  cursor: pointer;
  list-style: none;
}
.idea-compact-card > summary::-webkit-details-marker {
  display: none;
}
.idea-compact-card > summary span:first-child {
  display: grid;
  gap: .2rem;
  min-width: 0;
}
.idea-compact-card > summary strong,
.idea-compact-card > summary .muted {
  overflow-wrap: anywhere;
}
.idea-compact-card > summary small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.idea-compact-body {
  padding: 0 .85rem .9rem;
  border-top: 1px solid var(--border);
}
.idea-points {
  padding-left: 1.25rem;
}
.idea-points li + li {
  margin-top: .35rem;
}
.idea-edit-panel {
  margin-top: .75rem;
  padding: .75rem;
  border: 1px dashed var(--border);
  border-radius: .65rem;
}
.idea-edit-panel > summary,
.style-picker > summary {
  cursor: pointer;
  font-weight: 600;
}
.idea-edit-panel label:first-of-type {
  margin-top: .75rem;
}
.idea-create-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
  align-items: center;
  margin-top: .8rem;
}
.style-picker {
  position: relative;
}
.style-picker .style-choice-list {
  max-height: 16rem;
  overflow: auto;
}
.idea-generate-form {
  display: flex;
  gap: .65rem;
  align-items: end;
  margin-top: .9rem;
}
.idea-generate-form label {
  flex: 1;
  margin: 0;
}
.idea-empty {
  padding: .85rem;
  border: 1px dashed var(--border);
  border-radius: .75rem;
}
.idea-metrics {
  margin-bottom: .75rem;
}
.idea-legacy-list {
  margin-top: .85rem;
  padding: .75rem;
  border: 1px dashed var(--border);
  border-radius: .75rem;
  background: #fff;
}
.idea-legacy-list > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.idea-legacy-list[open] > summary {
  margin-bottom: .65rem;
}
.standalone-ideas {
  padding: 1rem;
}
.standalone-idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
@media (max-width: 980px) {
  .idea-source-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .idea-generate-form,
  .idea-create-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .idea-generate-form .button,
  .idea-create-actions .button {
    width: 100%;
  }
}
/* Идеи непосредственно в досье конкурента */
.dossier-ideas {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: .9rem;
  background: var(--surface-soft, #f8fafc);
}
.dossier-ideas > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}
.dossier-ideas > summary::-webkit-details-marker {
  display: none;
}
.dossier-ideas-body {
  padding: 0 1rem 1rem;
}
.dossier-ideas .style-choice-list {
  min-width: min(26rem, 75vw);
  max-height: 16rem;
  overflow: auto;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: var(--surface);
}
.dossier-ideas .style-choice-list label {
  display: block;
  margin: .35rem 0;
}


/* Компактная работа с конкурентами */
.collection-settings,.dossier-cases{margin-bottom:18px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);box-shadow:var(--shadow)}
.collection-settings>summary,.dossier-cases>summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;cursor:pointer;list-style:none}
.collection-settings>summary::-webkit-details-marker,.dossier-cases>summary::-webkit-details-marker,.action-menu>summary::-webkit-details-marker,.compact-source-post>summary::-webkit-details-marker{display:none}
.collection-settings>summary span:first-child,.dossier-cases>summary span:first-child{display:grid;gap:2px}
.collection-settings>summary small,.dossier-cases>summary small{color:var(--muted);font-weight:400}
.collection-settings-body{padding:0 16px 16px;border-top:1px solid var(--line)}
.compact-form-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.collection-profiles{margin-top:12px}
.competitor-card-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.action-menu{position:relative}
.action-menu>summary{display:grid;place-items:center;width:34px;height:32px;border:1px solid #cbd5e3;border-radius:8px;background:#fff;cursor:pointer;font-weight:800;letter-spacing:.08em}
.action-menu-popover{position:absolute;z-index:30;right:0;top:38px;width:270px;max-height:65vh;overflow-y:auto;padding:6px;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 16px 38px rgba(23,32,51,.18)}
.action-menu-popover a,.action-menu-popover button{display:flex;width:100%;min-height:34px;justify-content:flex-start;padding:7px 9px;border:0;background:transparent;text-align:left;font-size:12px}
.action-menu-popover a:hover,.action-menu-popover button:hover{border-radius:7px;background:var(--blue-soft);text-decoration:none}
.action-move-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:center;margin:6px 0}
.action-move-form select{min-width:0;font-size:12px}
.action-menu-popover .action-move-form button.primary{width:auto;min-width:82px;justify-content:center;background:var(--blue);color:#fff}
.analysis-summary{padding:15px 18px}
.analysis-summary-row{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.analysis-summary p{margin-bottom:0}
.dossier-tabs{display:flex;gap:6px;margin:16px 0;padding:5px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:var(--shadow);overflow-x:auto}
.dossier-tab{display:flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:0 13px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:13px;font-weight:700;white-space:nowrap}
.dossier-tab:hover{background:var(--blue-soft);color:var(--blue)}
.dossier-tab.active{background:var(--blue);color:#fff}
.dossier-tab span{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:rgba(37,99,235,.1);font-size:11px}
.dossier-tab.active span{background:rgba(255,255,255,.2)}
.dossier-panel{display:none}
.dossier-panel.active{display:block}
.dossier-style{padding:14px 16px}
.dossier-style>.card-head{margin-bottom:0}
.dossier-style>.card-head h2{margin-bottom:2px;font-size:17px}
.dossier-style>.card-head p{margin:0;font-size:13px}
.dossier-style>.source-post-text{margin-top:10px;padding:0;border:1px solid var(--line);border-radius:9px}
.dossier-style>.source-post-text>summary{padding:10px 12px;font-size:13px}
.dossier-style>.source-post-text[open]>summary{border-bottom:1px solid var(--line)}
.dossier-style>.source-post-text>*:not(summary){margin-left:12px;margin-right:12px}
.dossier-style .style-rename-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;align-items:end;gap:8px;margin-top:12px}
.dossier-style .style-rename-form label{margin:0}
.dossier-style .draft-readonly-text{font-size:13px;line-height:1.45}
.dossier-case-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;padding:0 16px 16px;border-top:1px solid var(--line)}
.dossier-case-card{padding:12px 2px;border-bottom:1px solid #edf0f5}
.dossier-case-card h3,.dossier-case-card p{margin-bottom:5px}
.dossier-case-card .actions{font-size:12px}
.competitor-post-feed{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.compact-source-post{margin:0;border-width:1px;border-radius:12px}
.compact-source-post>.source-post-header{cursor:pointer;padding:12px 14px;border-bottom:0}
.compact-source-post[open]>.source-post-header{border-bottom:1px solid var(--line)}
.compact-source-post>.source-post-header h2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:15px}
.post-summary-copy{min-width:0;flex:1}
.post-summary-media{position:relative;display:block;flex:0 0 48px;width:48px;height:48px;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:#eef3fa}
.post-summary-media img{width:100%;height:100%;object-fit:cover}
.post-summary-media b{position:absolute;right:2px;bottom:2px;padding:1px 5px;border-radius:999px;background:rgba(15,23,42,.78);color:#fff;font-size:10px}
.compact-source-post>.media-grid{display:flex;grid-template-columns:none;gap:8px;padding:10px 12px;overflow-x:auto;scrollbar-width:thin}
.compact-source-post .media-card{flex:0 0 88px;margin:0;border-radius:8px}
.compact-source-post .media-card img{width:88px;height:88px;object-fit:cover}
.compact-source-post .media-card figcaption{padding:4px 5px;font-size:9px;text-align:center}
.compact-source-post .post-insight-grid{grid-template-columns:1fr;padding:12px}
.generation-options{display:grid;grid-template-columns:minmax(130px,1fr) minmax(120px,1fr) minmax(190px,1.2fr);gap:8px;margin-top:10px;padding:10px;border:1px solid var(--line);border-radius:9px;background:#f8fafd}
.generation-options label{margin:0;font-size:12px}
.generation-options input,.generation-options select{min-height:36px}
.generation-options .check-row{display:flex;align-items:center;align-self:end;min-height:36px}
@media(max-width:980px){.compact-form-grid,.competitor-post-feed{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.compact-form-grid,.competitor-post-feed,.dossier-case-grid,.generation-options{grid-template-columns:1fr}}
@media(max-width:700px){.dossier-tabs{position:static}.dossier-style .style-rename-form{grid-template-columns:1fr}}
.image-lightbox{display:none;grid-template-columns:52px minmax(0,1fr) 52px;align-items:center;gap:10px}
.image-lightbox[open]{display:grid}
.image-lightbox>img{grid-column:2;max-width:100%;max-height:82vh;object-fit:contain;justify-self:center}
.image-lightbox-nav{display:grid;place-items:center;width:44px;height:54px;padding:0;border:0;border-radius:10px;background:rgba(255,255,255,.14);color:#fff;font-size:36px;cursor:pointer}
.image-lightbox-nav:hover{background:rgba(255,255,255,.24)}
.image-lightbox-nav.previous{grid-column:1;grid-row:1}
.image-lightbox-nav.next{grid-column:3;grid-row:1}
.image-lightbox-counter{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);padding:4px 9px;border-radius:999px;background:rgba(0,0,0,.62);color:#fff;font-size:12px}
.image-lightbox.single-image .image-lightbox-nav{visibility:hidden}
@media(max-width:600px){.image-lightbox{grid-template-columns:38px minmax(0,1fr) 38px;padding-left:6px;padding-right:6px}.image-lightbox-nav{width:36px;height:48px}}
.draft-visuals{margin-top:18px}
.visual-type-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:12px 0 14px}
.visual-type{position:relative;margin:0}
.visual-type input{position:absolute;opacity:0;pointer-events:none}
.visual-type span{display:grid;gap:3px;min-height:82px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer}
.visual-type small{color:var(--muted);font-size:11px;line-height:1.35}
.visual-type input:checked+span{border-color:var(--blue);background:var(--blue-soft);box-shadow:0 0 0 1px var(--blue)}
.draft-media-picker{margin:12px 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.draft-media-picker>summary{cursor:pointer;color:var(--blue);font-weight:700}
.draft-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:7px;max-height:270px;overflow:auto}
.draft-media-grid label{position:relative;margin:0}
.draft-media-grid input{position:absolute;top:5px;left:5px;z-index:1}
.draft-media-grid img{width:100%;height:76px;object-fit:cover;border:2px solid transparent;border-radius:8px}
.draft-media-grid input:checked+img{border-color:var(--blue)}
.draft-image-strip{display:flex;gap:8px;margin:10px 0 14px;overflow-x:auto}
.draft-image-item{position:relative;flex:0 0 96px}
.image-style-reference{width:96px;height:120px;flex:0 0 96px;object-fit:cover;border-radius:8px}
.draft-image-preview{display:block;width:96px;height:96px;padding:0;border:0;background:transparent;cursor:zoom-in}
.draft-image-preview img{width:96px;height:96px;object-fit:cover;border-radius:9px;border:1px solid var(--line)}
.draft-image-remove{position:absolute;top:4px;right:4px;display:grid;place-items:center;width:24px;min-height:24px;padding:0;border:1px solid rgba(255,255,255,.8);border-radius:999px;background:rgba(150,25,25,.9);color:#fff;font-size:17px;line-height:1}
.visual-options{margin:12px 0}
@media(max-width:1000px){.visual-type-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.visual-type-grid{grid-template-columns:1fr 1fr}}

/* РОП: формы и рекомендации используют общую навигацию приложения. */
.rop-form {display:grid;gap:16px;max-width:760px;}
.rop-form label {display:grid;gap:6px;}
.rop-form textarea {width:100%;box-sizing:border-box;}
.rop-form .rop-inline {display:flex;align-items:center;gap:8px;}
.rop-inline input[type=checkbox] {width:auto;}
.rop-text {white-space:pre-wrap;overflow-wrap:anywhere;}
.rop-finding {padding:16px 0;border-bottom:1px solid var(--border,#e2e8f0);}

.rop-table {overflow-x:auto;}
