/* OD Review — matches Release 2 Hub dark theme (Inter + purple glow + stars) */

/* Global: HTML `hidden` attribute must always win over any explicit
   display rule (e.g. .ghost-btn { display: inline-flex } would otherwise
   keep a `hidden` button visible). */
[hidden] {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: #09090f;
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
}

canvas#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.glow-tl,
.glow-br {
  position: fixed;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  filter: blur(180px);
}
.glow-tl {
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: #7c3aed;
  opacity: 0.07;
}
.glow-br {
  bottom: -150px;
  left: -150px;
  width: 460px;
  height: 460px;
  background: #06b6d4;
  opacity: 0.06;
}

/* ─── Topbar ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(9, 9, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.18);
}
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  transition: all 0.18s;
}
.back-home:hover {
  color: #e2e8f0;
  border-color: rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.18),
    rgba(124, 58, 237, 0.18)
  );
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}
.brand-title {
  font-weight: 700;
  font-size: 16px;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
}

.health-chip {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
}
.health-chip.ok {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}
.health-chip.err {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

/* ─── Buttons ─── */
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
}
.ghost-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.4);
  color: #e2e8f0;
}
.ghost-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  border: 1px solid rgba(192, 38, 211, 0.4);
  color: #fff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  transition: all 0.18s;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Final Approve — elite gold button ─── */
.final-approve-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 45%, #daa520 100%);
  border: 1px solid rgba(255, 215, 0, 0.55);
  color: #1a1200;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.18),
    0 4px 18px rgba(218, 165, 32, 0.45),
    0 0 32px rgba(255, 215, 0, 0.12);
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.final-approve-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.22) 0%,
    transparent 60%
  );
  pointer-events: none;
}
.final-approve-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.35),
    0 6px 24px rgba(218, 165, 32, 0.6),
    0 0 48px rgba(255, 215, 0, 0.2);
  background: linear-gradient(135deg, #c9990d 0%, #ffe033 45%, #e5b822 100%);
}
.final-approve-btn:active {
  transform: translateY(0);
}
.final-approve-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Final Approved badge (shown to all after eric.admin presses) ─── */
.final-approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(
    135deg,
    rgba(184, 134, 11, 0.18) 0%,
    rgba(255, 215, 0, 0.14) 100%
  );
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: #ffd700;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

/* ─── Main / sections ─── */
main {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title h2,
.section-title h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}
.section-title h3 {
  font-size: 15px;
}
.muted {
  color: #64748b;
  font-size: 12.5px;
}
.center {
  text-align: center;
}
.loading {
  padding: 60px;
  text-align: center;
  color: #64748b;
}

/* ─── Projects grid (list view) ─── */
.projects-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
.proj-card {
  position: relative;
  padding: 18px;
  background: rgba(15, 16, 24, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.proj-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), transparent 50%);
  -webkit-mask:
    linear-gradient(#000, #000) content-box,
    linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
}
.proj-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.35);
}
.proj-card:hover::before {
  opacity: 1;
}
.proj-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.proj-ticket {
  font-family: "JetBrains Mono", monospace, "Courier New";
  font-size: 13px;
  font-weight: 600;
  color: #a78bfa;
}
.proj-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12px;
  color: #94a3b8;
}
.proj-meta b {
  color: #cbd5e1;
  font-weight: 500;
}
.proj-links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ─── Status badge ─── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-uploading {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.status-generating {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.status-ready {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.status-revising {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.25);
}
.status-approved {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.3);
}
.status-failed {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.status-partial {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.32);
}
.status-pending,
.status-uploaded {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Additive metadata shown only for origin=aso_automation. */
.aso-automation-meta {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.06);
  color: #cbd5e1;
  font-size: 11px;
}
.aso-automation-meta > div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 7px;
  margin-top: 4px;
}
.aso-automation-meta .aso-automation-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0;
  color: #7dd3fc;
}
.aso-automation-meta code,
#detail-meta code {
  overflow-wrap: anywhere;
  color: #bae6fd;
}
.aso-automation-meta .aso-automation-error {
  color: #fca5a5;
}
.aso-automation-meta .aso-automation-error strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.flow-badge-aso {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.35);
  vertical-align: middle;
}
.aso-automation-label {
  color: #7dd3fc;
}
.aso-detail-error {
  color: #f87171;
  overflow-wrap: anywhere;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5e1;
  transition: all 0.15s;
  flex: 0 0 auto;
  align-self: flex-start;
  height: 24px;
  line-height: 1;
  white-space: nowrap;
}
.link-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.35);
  color: #e2e8f0;
}

/* ─── Detail view ─── */
.back-btn {
  margin-bottom: 18px;
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.detail-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.meta-card {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  padding: 18px 22px;
  background: rgba(15, 16, 24, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  margin-bottom: 28px;
  font-size: 13px;
}
.meta-card dt {
  color: #64748b;
  font-weight: 500;
}
.meta-card dd {
  margin: 0;
  color: #e2e8f0;
  word-break: break-all;
}
.meta-card a {
  color: #38bdf8;
  text-decoration: none;
}
.meta-card a:hover {
  text-decoration: underline;
}

/* ─── Screen cards ─── */
.screens-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.4) transparent;
}
.screens-grid::-webkit-scrollbar {
  height: 10px;
}
.screens-grid::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.4);
  border-radius: 5px;
}
.screens-grid > .screen-card {
  flex: 0 0 410px;
  width: 410px;
  scroll-snap-align: start;
}
.screen-card {
  padding: 14px;
  background: rgba(15, 16, 24, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.screen-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.screen-card .head strong {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 700;
}

.iframe-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 216%; /* iPhone 14/15 viewport 390x844 */
  background: #0c0c14;
  border-radius: 0; /* EDGE-TO-EDGE 2026-06-16: убрана рамка-карточка превью */
  overflow: hidden;
  margin-bottom: 10px;
  border: 0;
}
.iframe-wrap iframe,
.iframe-wrap img,
.iframe-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0c0c14;
}
/* iPhone HTML iframe — content is fixed at 390×844 (iPhone 14/15 viewport).
   Render iframe at native pixel size + scale via --iphone-scale (set by JS on
   render/resize) so labels/text positioned at right edge don't get clipped. */
.iframe-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 390px;
  height: 844px;
  object-fit: unset;
  transform-origin: top left;
  transform: scale(var(--iphone-scale, 0.97));
}
.iframe-wrap img,
.iframe-wrap video {
  object-fit: contain;
}
.iframe-wrap.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0;
  height: 200px;
  color: #475569;
  font-size: 12px;
}

.revision {
  font-size: 11.5px;
  color: #94a3b8;
  padding: 6px 9px;
  margin-bottom: 8px;
  background: rgba(251, 146, 60, 0.06);
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 6px;
}
.screen-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ─── Approve block ─── */
.approve-card {
  margin-top: 28px;
  padding: 22px;
  background: rgba(15, 16, 24, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 14px;
}
.approve-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.approve-title {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}
.approve-sub {
  font-size: 12.5px;
  color: #94a3b8;
  max-width: 540px;
}
#handoff-prompt {
  width: 100%;
  padding: 12px 14px;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  color: #cbd5e1;
  font-family: "JetBrains Mono", monospace, "Courier New";
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}
#handoff-prompt:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.4);
}

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 9, 15, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop[hidden] {
  display: none !important;
}
section[hidden] {
  display: none !important;
}
[hidden] {
  display: none !important;
}
.modal {
  width: 560px;
  max-width: 100%;
  background: #0f1018;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}
.modal p.muted {
  margin-bottom: 12px;
}
#revise-prompt {
  width: 100%;
  padding: 12px 14px;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
#revise-prompt:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.4);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}
#revise-status {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12.5px;
}
#revise-status.ok {
  color: #4ade80;
}
#revise-status.err {
  color: #f87171;
}

@media (max-width: 640px) {
  /* MOBILE-FIT: гард от горизонтального скролла страницы (плавающие боковые
     табы выходили за вьюпорт). Безопасно для вертикально-липкого топбара. */
  html,
  body {
    overflow-x: hidden;
  }
  /* На узком экране кнопки «Оценить»/«Применить» переносятся — даём блоку выше. */
  .screen-eval {
    height: 300px;
  }
  main {
    padding: 20px 14px 40px;
    overflow-x: hidden; /* MOBILE-FIT: kill page-level sideways scroll */
  }
  .topbar {
    padding: 12px 14px;
    gap: 10px;
  }
  .brand-sub {
    display: none;
  }
  /* MOBILE-FIT: карточка экрана = ширина телефона (свайп между экранами),
     а не фиксированные 410px, которые вылезали за вьюпорт и обрезали кнопки. */
  .screens-grid > .screen-card {
    flex: 0 0 calc(100vw - 28px);
    width: calc(100vw - 28px);
    max-width: 440px;
  }
  /* MOBILE-FIT: внутренние превью (в т.ч. масштабированный iPad-iframe 834px)
     не должны раздвигать страницу по горизонтали. */
  .screen-card {
    overflow: hidden;
  }
}

/* ─── Fullscreen viewer overlay ─── */
.viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(9, 9, 15, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.viewer-backdrop[hidden] {
  display: none !important;
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin-bottom: 14px;
}
.viewer-title {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 16px;
  flex: 1;
}
.viewer-frame {
  flex: 1;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 120px);
  aspect-ratio: 390 / 844;
  background: #0c0c14;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 4px rgba(15, 16, 24, 0.8);
}
.viewer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.viewer-prev,
.viewer-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 16, 24, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer-prev {
  left: 24px;
}
.viewer-next {
  right: 24px;
}
.viewer-prev:hover,
.viewer-next:hover {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.12);
}

/* ─── Toast notifications (bottom-right) ─── */
#toast-host {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  background: rgba(15, 16, 24, 0.94);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  max-width: 380px;
  transition:
    opacity 0.4s,
    transform 0.4s;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-info {
  border-color: rgba(56, 189, 248, 0.4);
}
.toast-info::before {
  content: "ℹ ";
  color: #38bdf8;
}
.toast-ok {
  border-color: rgba(74, 222, 128, 0.45);
}
.toast-ok::before {
  content: "✓ ";
  color: #4ade80;
}
.toast-err {
  border-color: rgba(248, 113, 113, 0.5);
}
.toast-err::before {
  content: "✗ ";
  color: #f87171;
}
.toast.toast-leave {
  opacity: 0;
  transform: translateX(8px);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── Content modal (wider than revise) ─── */
.modal-wide {
  width: 720px;
  max-width: 92vw;
}
.modal-wide #content-assets-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-right: 6px;
}
.asset-row {
  display: grid;
  grid-template-columns: 28px 56px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(15, 16, 24, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  align-items: center;
  transition: all 0.18s;
}
.asset-row:hover {
  border-color: rgba(124, 58, 237, 0.35);
}
.asset-row.selected {
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.06);
}
.asset-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7c3aed;
  cursor: pointer;
}
.asset-row .thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.12);
  object-fit: contain;
}
.asset-row .thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 10px;
  text-align: center;
}
.asset-row .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.asset-row .name {
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 500;
  word-break: break-all;
}
.asset-row .kind-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  width: fit-content;
}
.asset-row .kind-image {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}
.asset-row .kind-video {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
}
.asset-row .kind-spec {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}
.asset-row .feedback {
  grid-column: 1 / -1;
  margin-top: 6px;
  display: none;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}
.asset-row.selected .feedback {
  display: block;
}
.modal-footer-row textarea#content-overall-prompt {
  width: 100%;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12.5px;
  color: #e2e8f0;
  resize: vertical;
}
.modal-footer-row textarea#content-overall-prompt:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.4);
}

/* ─── Version chip on screen-card ─── */
.version-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  min-height: 26px;
  align-items: center;
}
/* Fixed-height row stops chips from shoving the iframe down — keeps screens
   visually aligned regardless of how many revisions exist. Scrolls if needed. */
.version-row {
  max-height: 26px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}
.version-row::-webkit-scrollbar {
  height: 4px;
}
.version-row::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 2px;
}
.version-chip {
  padding: 3px 8px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.version-chip:hover {
  color: #e2e8f0;
  border-color: rgba(124, 58, 237, 0.4);
}
.version-chip.active {
  background: rgba(124, 58, 237, 0.18);
  color: #c4b5fd;
  border-color: rgba(124, 58, 237, 0.4);
}

/* Color-code archived chips by "kind" of edit that produced them.
   Kind comes from heuristic on revision_prompt — see _detectRevisionKind
   in server.js. The .active chip keeps its violet "latest" color above. */
.version-chip[data-kind="revise"] {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}
.version-chip[data-kind="revise"]:hover {
  border-color: rgba(251, 191, 36, 0.6);
}
.version-chip[data-kind="regen_full"] {
  background: rgba(252, 165, 165, 0.1);
  border-color: rgba(252, 165, 165, 0.35);
  color: #fca5a5;
}
.version-chip[data-kind="regen_full"]:hover {
  border-color: rgba(252, 165, 165, 0.7);
}
.version-chip[data-kind="regen_layout"] {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.3);
  color: #fda4af;
}
.version-chip[data-kind="unify"] {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
}
.version-chip[data-kind="cta_enhance"] {
  background: rgba(147, 197, 253, 0.1);
  border-color: rgba(147, 197, 253, 0.3);
  color: #93c5fd;
}
.version-chip[data-kind="port_device"] {
  background: rgba(134, 239, 172, 0.08);
  border-color: rgba(134, 239, 172, 0.3);
  color: #86efac;
}
.version-chip[data-kind="rollback"] {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font-style: italic;
}
.version-chip[data-kind="spec_rewrite"] {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.3);
  color: #f9a8d4;
}
.version-chip[data-kind="unknown"] {
  /* falls back to default grey */
}

/* Legend block above the chips row so the user knows which color = which. */
.version-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 6px;
  font-size: 10px;
  color: #64748b;
}
.version-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.version-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid;
}

/* ── From-scratch modal (3 modes: AI / comment / reference) ─────── */
.fromscratch-modes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
@media (max-width: 720px) {
  .fromscratch-modes {
    grid-template-columns: 1fr;
  }
}
.fromscratch-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  background: rgba(15, 17, 25, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  color: #cbd5e1;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.fromscratch-mode-btn:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(30, 28, 52, 0.6);
}
.fromscratch-mode-btn.active {
  border-color: rgba(167, 139, 250, 0.9);
  background: rgba(40, 32, 80, 0.55);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.25);
}
.fromscratch-mode-btn .mode-icon {
  font-size: 22px;
  line-height: 1;
}
.fromscratch-mode-btn .mode-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}
.fromscratch-mode-btn .mode-desc {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  line-height: 1.45;
}
.fromscratch-section {
  margin-top: 10px;
}
.fromscratch-section textarea {
  width: 100%;
  background: rgba(15, 17, 25, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.fromscratch-section textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.6);
}

/* ─── Detail toolbar ─── */
.detail-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

/* ─── Design textarea ─── */
#design-text {
  width: 100%;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace, "Courier New";
  font-size: 12px;
  color: #e2e8f0;
  resize: vertical;
  min-height: 140px;
}
#design-text:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.4);
}

/* Device tabs (iPhone HTML / iPhone video / iPad video) on screen cards */
.device-tabs {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.device-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.device-tab:hover {
  background: rgba(124, 58, 237, 0.1);
  color: #c7b3ff;
  border-color: rgba(124, 58, 237, 0.3);
}
.device-tab.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.5);
  color: #c7b3ff;
}
.device-tab svg {
  flex-shrink: 0;
}

/* Stacked device blocks (iPhone HTML → iPhone video → iPad) */
.device-block {
  margin-bottom: 16px;
}
.device-block:last-child {
  margin-bottom: 0;
}
.device-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #c7b3ff;
  background: rgba(124, 58, 237, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.device-frame {
  position: relative;
  width: 100%;
  background: #0c0c14;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.device-frame video {
  width: 100%;
  height: auto;
  display: block;
  background: #0c0c14;
}
/* iPhone video aspect ratio matches device viewport */
.device-frame-iphone {
  padding-bottom: 216%;
}
.device-frame-iphone video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* iPad has landscape-ish aspect (~4:3 portrait, slightly wider than iPhone) */
.device-frame-ipad {
  padding-bottom: 133%;
}
.device-frame-ipad video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Bigger key buttons (Apply design system / Regenerate project) */
#detail-toolbar .ghost-btn,
#detail-toolbar #regen-link {
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  gap: 8px !important;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.35);
  color: #e2e8f0;
  transition: all 0.15s ease;
}
#detail-toolbar .ghost-btn:hover,
#detail-toolbar #regen-link:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(124, 58, 237, 0.6);
  transform: translateY(-1px);
}
#detail-toolbar .ghost-btn svg,
#detail-toolbar #regen-link svg {
  width: 16px !important;
  height: 16px !important;
}

/* Hide legacy iframe-wrap top margin when nested inside device-block */
.device-block.iphone-html .iframe-wrap {
  margin-bottom: 0;
}

/* PANEL-ABOVE-IPHONE: на iPhone панель действий поднимается НАД превью, чтобы
   готовые превью iPhone и iPad были ближе друг к другу. Блок оценки (screen-eval)
   остаётся ПОД превью. iPad-блок (.device-block.ipad-html) не трогаем — там панель
   остаётся снизу (дефолтный порядок DOM). */
.device-block.iphone-html {
  display: flex;
  flex-direction: column;
}
.device-block.iphone-html > .device-label {
  order: 0;
}
.device-block.iphone-html > .screen-actions.device-actions {
  order: 1;
  margin-top: 0;
  margin-bottom: 8px;
}
/* Блок «Оценка маркетолога» — НАД превью iPhone (сразу под кнопкой «Удалить»),
   чтобы превью iPhone и iPad были рядом, а оценка не висела снизу между ними. */
.device-block.iphone-html > .screen-eval {
  order: 2;
  margin-bottom: 8px;
  /* Единая высота блока оценки во всех карточках, чтобы iPhone-превью были на
     одном уровне (с оценкой блок выше, без оценки — ниже; min-height выравнивает). */
  min-height: 180px;
  box-sizing: border-box;
}
/* LAYOUT_REORDER_CSS (2026-06-01): competitor-ref ("Оригинал конкурента")
   должен идти МЕЖДУ оценкой маркетолога и нашим iframe HTML.
   Контейнер .device-block.iphone-html — это flex column с явными order
   у других детей (label=0, actions=1, eval=2). competitor-ref без правила
   имел order=0 → визуально подскакивал к верху сразу под label. Закрепляем
   его на 3, а iframe сдвигаем на 4 — финальный порядок снизу вверх:
   label(0) → actions(1) → eval(2) → competitor(3) → iframe(4). */
.device-block.iphone-html > .competitor-ref {
  order: 3;
}
.device-block.iphone-html > .iframe-wrap,
.device-block.iphone-html > .iframe-shell {
  /* FIX 2026-06-11: iframe обёрнут в .iframe-shell (кнопка ⟳ над экраном) —
     прямой-ребёнок селектор на .iframe-wrap перестал матчиться, shell получал
     order:0 и HTML подскакивал к верху карточки (выше рефа). */
  order: 4;
}

/* iPad HTML iframe — content is 1024×1366 fixed; we render the iframe at the
   real iPad pixel size and scale it down to fit the column via --ipad-scale
   (set by JS on every layout / resize). */
.iframe-wrap-ipad {
  position: relative;
  width: 100%;
  padding-bottom: 143.2%; /* 1194/834 = 1.432 → iPad Pro 11" portrait */
  background: #0c0c14;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0;
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.iframe-wrap-ipad iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 834px;
  height: 1194px;
  border: 0;
  background: #0c0c14;
  transform-origin: top left;
  transform: scale(var(--ipad-scale, 0.4));
}
.iframe-wrap-ipad.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 24px;
  padding-bottom: 24px;
}
.iframe-wrap-ipad.empty {
  padding-bottom: 24px;
}

/* Collapsed preview video blocks (click to expand) */
.device-block.collapsed details summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.device-block.collapsed details summary::-webkit-details-marker {
  display: none;
}
.device-block.collapsed details summary::before {
  content: "▸ ";
  margin-right: 4px;
}
.device-block.collapsed details[open] summary::before {
  content: "▾ ";
}
.device-block.collapsed details[open] .device-frame {
  margin-top: 8px;
}

/* Revise modal — device picker + intent chips */
.revise-section {
  margin-bottom: 18px;
}
.revise-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #c7b3ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.revise-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 6px;
  font-style: italic;
}
.device-picker {
  display: flex;
  gap: 10px;
}
.device-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #e2e8f0;
  user-select: none;
  transition: all 0.12s ease;
}
.device-pill:hover {
  border-color: rgba(124, 58, 237, 0.4);
}
.device-pill:has(input:checked) {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.5);
  color: #c7b3ff;
}
.intent-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.intent-chip {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #cbd5e1;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.intent-chip:hover {
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(124, 58, 237, 0.45);
  color: #e2e8f0;
}
.intent-chip.active {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.6);
  color: #c7b3ff;
}

/* ── Project-level toolbar v2: grouped sections ─────────────────────── */
.toolbar-grouped {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 4px;
}
@media (max-width: 920px) {
  .toolbar-grouped {
    grid-template-columns: 1fr;
  }
}
.toolbar-group {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(20, 22, 32, 0.5);
  border-radius: 14px;
  padding: 8px 14px 14px;
  margin: 0;
}
.toolbar-group-regen {
  border-color: rgba(252, 165, 165, 0.22);
  background: rgba(60, 22, 22, 0.18);
}
.toolbar-group-polish {
  border-color: rgba(167, 139, 250, 0.22);
  background: rgba(40, 28, 60, 0.18);
}
.toolbar-legend {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 8px;
  margin-left: -4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #e2e8f0;
}
.toolbar-legend .legend-icon {
  font-size: 14px;
}
.toolbar-legend .legend-hint {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: #94a3b8;
  font-size: 11px;
}
.toolbar-group-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.toolbar-group-polish .toolbar-group-body {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 720px) {
  .toolbar-group-body,
  .toolbar-group-polish .toolbar-group-body {
    grid-template-columns: 1fr;
  }
}
.action-btn {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px !important;
  text-align: left;
  width: 100%;
  background: rgba(15, 17, 25, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.05s;
}
.action-btn:hover {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(30, 28, 52, 0.6);
}
.action-btn:active {
  transform: translateY(1px);
}
.action-btn .btn-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.action-btn .btn-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.action-btn .btn-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: normal;
}
.action-btn .btn-desc {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
}
.action-btn-danger {
  border-color: rgba(252, 165, 165, 0.35);
}
.action-btn-danger:hover {
  border-color: rgba(252, 165, 165, 0.7);
  background: rgba(60, 22, 22, 0.35);
}
.action-btn-danger .btn-title {
  color: #fca5a5;
}
.action-btn-unify .btn-title {
  color: #fbbf24;
}
.action-btn-unify:hover {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(45, 36, 12, 0.4);
}
.action-btn-cta .btn-title {
  color: #93c5fd;
}
.action-btn-cta:hover {
  border-color: rgba(147, 197, 253, 0.6);
  background: rgba(15, 30, 55, 0.5);
}
.action-btn-design .btn-title {
  color: #a78bfa;
}
.action-btn-design:hover {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(30, 22, 55, 0.4);
}

/* ── Regen drawer (slide-in right) ──────────────────────────────────── */
.regen-drawer {
  position: fixed;
  inset: 0;
  z-index: 900;
}
.regen-drawer[hidden] {
  display: none;
}
.regen-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.6);
  backdrop-filter: blur(4px);
  animation: drawer-fade-in 0.15s ease-out;
}
.regen-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(580px, 92vw);
  background: #0d0f17;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  animation: drawer-slide-in 0.22s ease-out;
}
@keyframes drawer-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes drawer-slide-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}
.regen-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 14px;
  color: #e2e8f0;
}
.regen-drawer-panel iframe {
  flex: 1;
  border: 0;
  width: 100%;
  background: #0b0d11;
}

/* ── Project-level toolbar — replace emoji span with SVG ─────────── */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #cbd5e1;
}
.action-btn-danger .btn-icon {
  color: #fca5a5;
  background: rgba(252, 165, 165, 0.08);
  border-color: rgba(252, 165, 165, 0.25);
}
.action-btn-unify .btn-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.25);
}
.action-btn-cta .btn-icon {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.08);
  border-color: rgba(147, 197, 253, 0.25);
}
.action-btn-design .btn-icon {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.25);
}
.toolbar-legend .legend-icon {
  color: inherit;
  vertical-align: -2px;
}

/* ── Per-screen action groups (2 rows) ─────────────────────────── */
.screen-actions.device-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 10px;
  margin-top: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15) inset;
}
.screen-act-group-label {
  color: #64748b !important;
}
.screen-act-group-edit .screen-act-group-label {
  color: #475569 !important;
}
.screen-act-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.screen-act-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #64748b;
  padding-left: 2px;
}
.screen-act-group-edit .screen-act-group-label {
  color: #94a3b8;
}
.screen-act-group-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.screen-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.12s,
    background 0.12s,
    color 0.12s,
    box-shadow 0.12s,
    transform 0.06s;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
  min-height: 52px;
}
.screen-act-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}
.screen-act-btn:hover .screen-act-icon {
  background: #ffffff;
  color: #0f172a;
}
.screen-act-btn:active {
  transform: translateY(1px);
}
.screen-act-btn .screen-act-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #0f172a;
  color: #ffffff;
  transition:
    background 0.12s,
    color 0.12s;
}
.screen-act-btn .screen-act-label {
  flex: 1;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.2;
  word-break: break-word;
}
.screen-act-btn.act-danger {
  color: #b91c1c;
  border-color: #b91c1c;
}
.screen-act-btn.act-danger .screen-act-icon {
  background: #b91c1c;
  color: #ffffff;
}
.screen-act-btn.act-danger:hover {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.3);
}
.screen-act-btn.act-danger:hover .screen-act-icon {
  background: #ffffff;
  color: #b91c1c;
}
.screen-act-btn.act-warn {
  color: #b45309;
  border-color: #b45309;
}
.screen-act-btn.act-warn .screen-act-icon {
  background: #b45309;
  color: #ffffff;
}
.screen-act-btn.act-warn:hover {
  background: #b45309;
  color: #ffffff;
  border-color: #b45309;
  box-shadow: 0 6px 14px rgba(180, 83, 9, 0.3);
}
.screen-act-btn.act-warn:hover .screen-act-icon {
  background: #ffffff;
  color: #b45309;
}
.screen-act-btn.act-accent {
  color: #6d28d9;
  border-color: #6d28d9;
}
.screen-act-btn.act-accent .screen-act-icon {
  background: #6d28d9;
  color: #ffffff;
}
.screen-act-btn.act-accent:hover {
  background: #6d28d9;
  color: #ffffff;
  border-color: #6d28d9;
  box-shadow: 0 6px 14px rgba(109, 40, 217, 0.3);
}
.screen-act-btn.act-accent:hover .screen-act-icon {
  background: #ffffff;
  color: #6d28d9;
}
.act-photoshop {
  border-color: #a855f7 !important;
  color: #6d28d9 !important;
  background: #faf5ff !important;
}
.act-photoshop .screen-act-icon {
  background: #a855f7 !important;
  color: #ffffff !important;
}
.act-photoshop:hover {
  background: #a855f7 !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
  box-shadow: 0 6px 14px rgba(168, 85, 247, 0.4);
}
.act-photoshop:hover .screen-act-icon {
  background: #ffffff !important;
  color: #6d28d9 !important;
}
/* Danger zone — single full-width button «🗑 Удалить экран». */
.screen-act-group-danger {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(220, 38, 38, 0.25);
}
.screen-act-group-danger .screen-act-group-label {
  color: #b91c1c;
}
.screen-act-group-danger .screen-act-group-body {
  grid-template-columns: 1fr;
}
.screen-act-btn.act-delete {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}
.screen-act-btn.act-delete .screen-act-icon {
  background: rgba(248, 113, 113, 0.2);
  color: #dc2626;
}
.screen-act-btn.act-delete:hover {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.screen-act-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  margin-top: 4px;
  font-size: 11px;
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.06);
  border: 1px solid rgba(147, 197, 253, 0.25);
  border-radius: 7px;
  text-decoration: none;
}
.screen-act-open:hover {
  background: rgba(147, 197, 253, 0.12);
  border-color: rgba(147, 197, 253, 0.5);
}

/* ─── Photoshop modal (Pt.5 — v2 fullscreen). The .act-photoshop button styling lives at the .screen-act-btn block above; the duplicate that was here was overriding it with pale color (#d8b4fe) and was removed in bugfix. */
.photoshop-backdrop {
  padding: 0 !important;
}
.photoshop-fullscreen {
  width: 98vw !important;
  max-width: 1900px !important;
  height: 96vh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.photoshop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 16, 24, 0.9);
  flex-shrink: 0;
  gap: 14px;
}
.photoshop-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.photoshop-head-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.photoshop-head-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.photoshop-device-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  font-weight: 500;
}
.photoshop-device-toggle {
  cursor: pointer;
  transition: all 0.12s;
  border: 1px solid transparent;
}
.photoshop-device-toggle:hover {
  background: rgba(168, 85, 247, 0.18);
  color: #f5d0fe;
  border-color: rgba(168, 85, 247, 0.45);
}
.photoshop-mode-switch {
  display: inline-flex;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.photoshop-mode-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #cbd5e1;
  border-radius: 7px;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.photoshop-mode-btn:hover {
  background: rgba(168, 85, 247, 0.1);
  color: #e9d5ff;
}
.photoshop-mode-btn.active {
  background: rgba(168, 85, 247, 0.25);
  color: #f5d0fe;
}
.photoshop-zoom-btn {
  padding: 4px 10px !important;
  font-size: 14px;
  font-weight: 700;
  min-width: 32px;
}
.photoshop-zoom-label {
  font-size: 12px;
  color: #94a3b8;
  min-width: 42px;
  text-align: center;
}
.photoshop-body-v2 {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: 0;
  min-width: 0;
}
.photoshop-canvas-wrap {
  position: relative;
  background: #06060a;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.photoshop-canvas-stage {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  min-height: 0;
  min-width: 0;
}
.photoshop-canvas-inner {
  position: relative;
  flex: 0 0 auto;
}
.photoshop-canvas-wrap img,
.photoshop-canvas-wrap iframe {
  display: block;
  margin: 0;
  user-select: none;
  -webkit-user-drag: none;
  background: #fff;
}
.photoshop-canvas-wrap iframe {
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}
.photoshop-canvas-wrap img {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}
.photoshop-frame-selector {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(15, 16, 24, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  backdrop-filter: blur(6px);
}
.photoshop-frame-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.12s;
}
.photoshop-frame-btn:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
}
.photoshop-frame-btn.active {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.55);
  color: #f5d0fe;
}
.photoshop-frame-replay {
  margin-left: auto;
  font-size: 11px;
}
.photoshop-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 12px;
  background: rgba(6, 6, 10, 0.85);
  z-index: 9;
}
.photoshop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
}
#photoshop-zone-layer {
  cursor: crosshair;
}
.photoshop-zone-rect {
  position: absolute;
  border: 2px dashed #c084fc;
  background: rgba(192, 132, 252, 0.15);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  border-radius: 3px;
}
.photoshop-element-box {
  position: absolute;
  border: 1.5px solid rgba(96, 165, 250, 0.6);
  background: rgba(96, 165, 250, 0.05);
  pointer-events: auto;
  cursor: pointer;
  border-radius: 3px;
  transition:
    border-color 0.12s,
    background 0.12s,
    box-shadow 0.12s;
}
/* Containers — wrappers around other detected elements. No fill so clicks
   pass through to the child element underneath (browser picks topmost z). */
.photoshop-element-box.is-container {
  background: transparent;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
}
.photoshop-element-box.is-container .photoshop-element-label {
  background: rgba(148, 163, 184, 0.6);
  color: #0b1020;
}
.photoshop-element-box:hover {
  border-color: rgba(96, 165, 250, 1);
  background: rgba(96, 165, 250, 0.18);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.55);
  /* Bump above everything so the hovered box is always the click target */
  z-index: 9999 !important;
}
.photoshop-element-box.is-container:hover {
  border-color: rgba(96, 165, 250, 1);
  background: rgba(96, 165, 250, 0.07);
}
.photoshop-element-box.queued {
  border-color: #c084fc;
  background: rgba(192, 132, 252, 0.18);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.35);
}
.photoshop-element-box.move-mode {
  cursor: grab;
}
.photoshop-element-box.resize-mode {
  cursor: default;
}
.photoshop-resize-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #f5d0fe;
  border: 1.5px solid #a855f7;
  border-radius: 2px;
  z-index: 10;
}
.photoshop-resize-handle.h-nw {
  top: -5px;
  left: -5px;
  cursor: nwse-resize;
}
.photoshop-resize-handle.h-n {
  top: -5px;
  left: 50%;
  margin-left: -5px;
  cursor: ns-resize;
}
.photoshop-resize-handle.h-ne {
  top: -5px;
  right: -5px;
  cursor: nesw-resize;
}
.photoshop-resize-handle.h-e {
  top: 50%;
  right: -5px;
  margin-top: -5px;
  cursor: ew-resize;
}
.photoshop-resize-handle.h-se {
  bottom: -5px;
  right: -5px;
  cursor: nwse-resize;
}
.photoshop-resize-handle.h-s {
  bottom: -5px;
  left: 50%;
  margin-left: -5px;
  cursor: ns-resize;
}
.photoshop-resize-handle.h-sw {
  bottom: -5px;
  left: -5px;
  cursor: nesw-resize;
}
.photoshop-resize-handle.h-w {
  top: 50%;
  left: -5px;
  margin-top: -5px;
  cursor: ew-resize;
}
.photoshop-element-box.dragging {
  cursor: grabbing;
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.25);
  z-index: 100;
}
.photoshop-element-label {
  position: absolute;
  top: -18px;
  left: -1px;
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(96, 165, 250, 0.95);
  color: #0b1020;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
.photoshop-element-box:hover .photoshop-element-label,
.photoshop-element-box.queued .photoshop-element-label,
.photoshop-element-box.dragging .photoshop-element-label {
  opacity: 1;
}
.photoshop-element-box.queued .photoshop-element-label {
  background: #c084fc;
}
.photoshop-element-box.dragging .photoshop-element-label {
  background: #34d399;
}
.photoshop-status-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(15, 16, 24, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 11px;
  color: #cbd5e1;
  z-index: 10;
}
.photoshop-sidebar {
  display: flex;
  flex-direction: column;
  background: rgba(11, 11, 17, 0.95);
  overflow-y: auto;
  min-height: 0;
}
.photoshop-side-section {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.photoshop-side-section:last-child {
  border-bottom: none;
}
.photoshop-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.photoshop-side-section .hint {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
}
.photoshop-side-section textarea {
  width: 100%;
  padding: 9px 11px;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.photoshop-side-section textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.6);
}
.photoshop-coords {
  font-size: 11px;
}
.photoshop-mode-pane {
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.photoshop-engine-row {
  display: flex;
  gap: 6px;
}
.photoshop-engine-row .primary-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.photoshop-engine-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  font-family: inherit;
}
.photoshop-row-btns {
  display: flex;
  gap: 6px;
}
.photoshop-row-btns .ghost-btn,
.photoshop-row-btns .primary-btn {
  flex: 1;
}
.photoshop-elements-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.photoshop-elements-item {
  padding: 7px 10px;
  font-size: 11px;
  background: rgba(96, 165, 250, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: all 0.1s;
}
.photoshop-elements-item:hover {
  background: rgba(96, 165, 250, 0.13);
  border-color: rgba(96, 165, 250, 0.4);
}
.photoshop-elements-item.queued {
  background: rgba(192, 132, 252, 0.13);
  border-color: rgba(192, 132, 252, 0.5);
  color: #e9d5ff;
}
.photoshop-elements-item-dim {
  color: #64748b;
  font-size: 10px;
}
.photoshop-queue-section {
  flex: 1 1 auto;
  min-height: 0;
}
.photoshop-queue-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 10px;
  background: rgba(192, 132, 252, 0.3);
  color: #f5d0fe;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  vertical-align: middle;
}
.photoshop-queue-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 320px;
  overflow-y: auto;
}
.photoshop-queue-empty {
  font-size: 11px;
  padding: 8px;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 6px;
}
.photoshop-queue-item {
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: 7px;
  padding: 8px;
  background: rgba(192, 132, 252, 0.05);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.photoshop-queue-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.photoshop-queue-item-kind {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.photoshop-queue-item-kind.zone {
  background: rgba(192, 132, 252, 0.25);
  color: #f5d0fe;
}
.photoshop-queue-item-kind.element {
  background: rgba(96, 165, 250, 0.25);
  color: #bfdbfe;
}
.photoshop-queue-item-kind.move {
  background: rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
}
.photoshop-queue-item-label {
  flex: 1;
  color: #e2e8f0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photoshop-queue-item-remove {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.photoshop-queue-item-remove:hover {
  color: #fca5a5;
}
.photoshop-queue-item textarea {
  font-size: 11.5px;
  padding: 6px 8px;
  min-height: 38px;
}
.photoshop-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.photoshop-chip {
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.photoshop-chip:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.45);
  color: #f5d0fe;
}
.photoshop-bulk-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(20, 20, 30, 0.4);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  cursor: pointer;
}
.photoshop-bulk-toggle:has(input:checked) {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.45);
  border-style: solid;
  color: #f5d0fe;
}
.photoshop-bulk-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}
.photoshop-bulk-hint {
  font-size: 9.5px;
  margin-left: auto;
}
.photoshop-apply-all {
  width: 100%;
  font-size: 13px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  justify-content: center;
}
.photoshop-apply-all:disabled {
  opacity: 0.85;
  cursor: progress;
}
.ps-prog-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
.ps-prog-time {
  font-variant-numeric: tabular-nums;
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
}
.ps-prog-bar {
  position: relative;
  display: block;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
}
.ps-prog-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  transition: width 0.25s linear;
}

/* ─── Floating Photoshop jobs panel (Pt.4 — async progress) ─── */
.ps-jobs-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 340px;
  max-height: 60vh;
  background: rgba(15, 16, 24, 0.97);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.ps-jobs-panel[hidden] {
  display: none !important;
}
.ps-jobs-panel.collapsed .ps-jobs-body {
  display: none;
}
.ps-jobs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(168, 85, 247, 0.1);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.ps-jobs-title {
  font-size: 12px;
  font-weight: 700;
  color: #f5d0fe;
}
.ps-jobs-toggle {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.ps-jobs-toggle:hover {
  background: rgba(168, 85, 247, 0.18);
}
.ps-jobs-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.ps-jobs-empty {
  font-size: 11px;
  padding: 12px;
  text-align: center;
}
.ps-job-card {
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ps-job-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.ps-job-screen {
  font-weight: 700;
  color: #e2e8f0;
}
.ps-job-device {
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
}
.ps-job-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #fde68a;
  font-weight: 700;
}
.ps-job-project {
  font-size: 10px;
}
.ps-job-stage {
  font-size: 11px;
  color: #c4b5fd;
  font-weight: 600;
}
.ps-job-summary {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-job-bar {
  position: relative;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.ps-job-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  transition: width 0.4s linear;
}
.ps-job-card.status-done {
  border-color: rgba(134, 239, 172, 0.45);
}
.ps-job-card.status-done .ps-job-bar-fill {
  background: linear-gradient(90deg, #86efac, #4ade80);
}
.ps-job-card.status-failed {
  border-color: rgba(252, 165, 165, 0.45);
  background: rgba(127, 29, 29, 0.12);
}
.ps-job-card.status-failed .ps-job-bar-fill {
  background: linear-gradient(90deg, #f87171, #ef4444);
}
.ps-job-card.status-failed .ps-job-stage {
  color: #fca5a5;
}
.ps-job-card.status-cancelled {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.12);
}
.ps-job-card.status-cancelled .ps-job-bar-fill {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}
.ps-job-card.status-cancelled .ps-job-stage {
  color: #fbbf24;
}
/* Screen lock banner inside Photoshop modal */
.photoshop-lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.1);
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
}
.ps-lock-icon {
  font-size: 22px;
}
.ps-lock-title {
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}
.ps-lock-sub {
  font-size: 10.5px;
}

/* Compare modal */
.photoshop-compare-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  background: #06060a;
  min-height: 0;
}
.photoshop-compare-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.photoshop-compare-side-head {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px 8px 0 0;
  text-align: center;
}
.photoshop-compare-side iframe {
  flex: 1 1 auto;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  min-height: 0;
}
.photoshop-compare-select {
  padding: 5px 10px;
  font-size: 11px;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  font-family: inherit;
}
.ps-job-diff {
  margin-top: 4px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 5px;
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 100px;
  overflow-y: auto;
}
.ps-diff-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-diff-row.added {
  color: #86efac;
}
.ps-diff-row.removed {
  color: #fca5a5;
}
.ps-diff-row.changed {
  color: #cbd5e1;
}
.ps-diff-old {
  color: #fca5a5;
  text-decoration: line-through;
}
.ps-diff-new {
  color: #86efac;
}
.ps-color-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-right: 3px;
  vertical-align: -1px;
}
.ps-job-stream {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  line-height: 1.3;
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  color: #93c5fd;
  max-height: 56px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-all;
  border-left: 2px solid #60a5fa;
  margin-top: 3px;
}
.ps-job-cost {
  font-size: 10px;
  padding: 3px 6px;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 4px;
  color: #fbbf24;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 3px;
}
.ps-job-actions {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}
.ps-job-act {
  flex: 1;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 5px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.12s;
}
.ps-job-act:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.5);
  color: #f5d0fe;
}
.ps-job-act:disabled {
  opacity: 0.5;
  cursor: wait;
}
.ps-job-cancel:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.55) !important;
  color: #fca5a5 !important;
}
.ps-job-retry:hover {
  background: rgba(167, 139, 250, 0.2) !important;
  border-color: rgba(167, 139, 250, 0.55) !important;
  color: #c4b5fd !important;
}
.photoshop-history-list {
  font-size: 11px;
  max-height: 140px;
  overflow-y: auto;
}
.photoshop-history-row {
  padding: 4px 0;
  color: #94a3b8;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.08);
}
.photoshop-history-row:last-child {
  border-bottom: none;
}
.photoshop-history-row b {
  color: #c4b5fd;
}
@media (max-width: 1100px) {
  .photoshop-body-v2 {
    grid-template-columns: 1fr 320px;
  }
}
.photoshop-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 14px;
}
.photoshop-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 14px;
  background: rgba(20, 20, 30, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  color: #cbd5e1;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.photoshop-tab:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.3);
}
.photoshop-tab.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.55);
  color: #f5d0fe;
}
.photoshop-tab-title {
  font-size: 13px;
  font-weight: 600;
}
.photoshop-tab-desc {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}
.photoshop-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  min-height: 480px;
}
.photoshop-canvas-wrap {
  position: relative;
  background: #06060a;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}
.photoshop-canvas-wrap img {
  display: block;
  max-width: 100%;
  max-height: 600px;
  user-select: none;
  -webkit-user-drag: none;
}
.photoshop-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 12px;
  background: rgba(6, 6, 10, 0.7);
  z-index: 2;
}
.photoshop-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
}
#photoshop-zone-layer {
  cursor: crosshair;
}
.photoshop-zone-rect {
  position: absolute;
  border: 2px dashed #c084fc;
  background: rgba(192, 132, 252, 0.12);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  border-radius: 3px;
}
.photoshop-element-box {
  position: absolute;
  border: 1.5px solid rgba(96, 165, 250, 0.7);
  background: rgba(96, 165, 250, 0.06);
  pointer-events: auto;
  cursor: pointer;
  border-radius: 3px;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.photoshop-element-box:hover {
  border-color: rgba(96, 165, 250, 1);
  background: rgba(96, 165, 250, 0.18);
}
.photoshop-element-box.selected {
  border-color: #f0abfc;
  background: rgba(240, 171, 252, 0.18);
  box-shadow: 0 0 0 2px rgba(240, 171, 252, 0.35);
}
.photoshop-element-label {
  position: absolute;
  top: -20px;
  left: -1px;
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(96, 165, 250, 0.95);
  color: #0b1020;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
}
.photoshop-element-box.selected .photoshop-element-label {
  background: #f0abfc;
}
.photoshop-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.photoshop-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photoshop-pane .hint {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
}
.photoshop-pane textarea {
  width: 100%;
  padding: 10px 12px;
  background: #0c0c14;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.photoshop-pane textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.6);
}
.photoshop-elements-item {
  padding: 6px 10px;
  margin-bottom: 4px;
  font-size: 11px;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.photoshop-elements-item:hover {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.4);
}
.photoshop-elements-item.selected {
  background: rgba(240, 171, 252, 0.16);
  border-color: rgba(240, 171, 252, 0.55);
  color: #f5d0fe;
}
.photoshop-history {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.photoshop-history-row {
  font-size: 11px;
  padding: 4px 0;
  color: #94a3b8;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.08);
}
.photoshop-history-row:last-child {
  border-bottom: none;
}
.photoshop-history-row b {
  color: #c4b5fd;
}
@media (max-width: 900px) {
  .photoshop-body {
    grid-template-columns: 1fr;
  }
}

/* ── Revise modal: context sidebar with screen thumbnails ───────────── */
.revise-modal-with-context {
  position: relative;
  max-width: 880px;
}
.revise-context-sidebar {
  position: absolute;
  top: 0;
  right: 100%;
  width: 200px;
  margin-right: 12px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  padding: 12px;
  max-height: 80vh;
  overflow-y: auto;
}
.revise-context-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #94a3b8;
}
.revise-context-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.revise-context-thumb {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(30, 30, 45, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  font-size: 11px;
  color: #cbd5e1;
}
.revise-context-thumb.active {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.12);
  color: #f5d0fe;
}
.revise-context-thumb img {
  width: 32px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #0f172a;
  flex-shrink: 0;
}
.revise-context-thumb .rtc-num {
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
@media (max-width: 1200px) {
  .revise-context-sidebar {
    position: static;
    width: auto;
    margin: 0 0 14px 0;
    max-height: 240px;
  }
  .revise-context-thumbs {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .revise-context-thumb {
    min-width: 110px;
  }
}

/* "Внести правку" button toggles the regen drawer — show active state */
#regen-link.active-toggle {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.55);
  color: #f5d0fe;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4) inset;
}
#regen-link.active-toggle .btn-title::after {
  content: " ✕";
  opacity: 0.7;
  margin-left: 4px;
}

/* Floating side-edge handle so the drawer is also reachable without
   scrolling back up to the toolbar (the user complained the button was
   far from the drawer panel on the right). */
.regen-drawer-handle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(168, 85, 247, 0.85);
  color: #fff;
  padding: 12px 8px;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  z-index: 998;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: -2px 0 12px rgba(168, 85, 247, 0.4);
  border: none;
  transition:
    background 0.15s,
    transform 0.15s;
}
.regen-drawer-handle:hover {
  background: rgba(168, 85, 247, 1);
  transform: translateY(-50%) translateX(-2px);
}
.regen-drawer-handle.drawer-open {
  display: none; /* drawer itself has its own ✕ close button */
}

/* ═══════════════════════════════════════════════════════════════════
   OD CHAT SIDEBAR (2026-05-21) — left-side panel, multi-tab,
   live-stream agent activity + version-info popover.
   Appended to public/style.css.
   ═══════════════════════════════════════════════════════════════════ */

.od-chat-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9000;
  background: linear-gradient(135deg, #6d28d9, #a855f7);
  color: #fff;
  border: 0;
  border-radius: 0 10px 10px 0;
  padding: 12px 10px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.od-chat-toggle:hover {
  transform: translateY(-50%) translateX(2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.55);
}
.od-chat-toggle.is-open {
  display: none;
}

.od-chat-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: min(460px, 38vw);
  z-index: 9500;
  background: #0a0b14;
  border-right: 1px solid rgba(124, 58, 237, 0.35);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  color: #e2e8f0;
  font-size: 13px;
}
.od-chat-sidebar[hidden] {
  display: none;
}

.od-chat-header {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 8px;
  padding: 10px 12px;
  background: rgba(124, 58, 237, 0.08);
  border-bottom: 1px solid rgba(124, 58, 237, 0.25);
}
.od-chat-close {
  grid-row: 1;
  grid-column: 1;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.od-chat-close:hover {
  color: #fff;
}
.od-chat-title {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  font-weight: 700;
  color: #c7b3ff;
}
.od-chat-newbtn {
  grid-row: 1;
  grid-column: 3;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
}
.od-chat-newbtn:hover {
  background: rgba(168, 85, 247, 0.35);
}
.od-chat-tabs {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.od-chat-tab {
  background: rgba(30, 32, 50, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.od-chat-tab:hover {
  border-color: rgba(168, 85, 247, 0.45);
}
.od-chat-tab.active {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #fff;
  font-weight: 600;
}

.od-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.od-chat-empty {
  color: #64748b;
  font-size: 12px;
  text-align: center;
  padding: 24px 12px;
}

.od-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}
.od-chat-msg.user {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  align-self: flex-end;
  max-width: 88%;
}
.od-chat-msg.agent {
  background: rgba(30, 32, 50, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  align-self: flex-start;
  max-width: 92%;
}
.od-chat-msg.tool {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #a78bfa;
  font-size: 11.5px;
  align-self: flex-start;
  max-width: 90%;
  font-family: "SF Mono", Menlo, monospace;
}
.od-chat-msg .meta {
  font-size: 10.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.od-chat-msg.agent.partial::after {
  content: "▍";
  color: #a855f7;
  animation: od-chat-blink 1s infinite;
}
@keyframes od-chat-blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}
.od-chat-msg.terminal {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  align-self: center;
  max-width: 96%;
  font-size: 11.5px;
}
.od-chat-msg.terminal.failed {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

.od-chat-input {
  flex-shrink: 0;
  border-top: 1px solid rgba(124, 58, 237, 0.25);
  padding: 10px 12px;
  background: rgba(10, 11, 20, 0.95);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.od-chat-row {
  display: flex;
  gap: 6px;
}
.od-chat-target-label {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.od-chat-target-file {
  flex: 1;
  background: rgba(30, 32, 50, 0.6);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11.5px;
}
.od-chat-input textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 220px;
  background: rgba(20, 22, 36, 0.6);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
}
.od-chat-input textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.6);
}
.od-chat-send {
  background: linear-gradient(135deg, #6d28d9, #a855f7);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.od-chat-send[disabled] {
  background: rgba(168, 85, 247, 0.25);
  cursor: not-allowed;
  opacity: 0.6;
}
.od-chat-send:not([disabled]):hover {
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.45);
}

/* ─── Version-chip "i" button + info-modal ─── */
.version-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 4px;
  margin-right: 2px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 32, 50, 0.5);
  color: #94a3b8;
  font-size: 10.5px;
  font-style: italic;
  font-weight: 700;
  font-family: serif;
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
  padding: 0;
}
.version-info-btn:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #fff;
}
.version-info-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.version-info-modal[hidden] {
  display: none;
}
.version-info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 12, 0.7);
}
.version-info-box {
  position: relative;
  background: #0d0e16;
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 14px;
  padding: 22px 24px;
  max-width: 560px;
  width: 92%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  color: #e2e8f0;
}
.version-info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.version-info-close:hover {
  color: #fff;
}
.version-info-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.version-info-chip {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid #a855f7;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
  color: #fff;
  font-size: 12px;
}
.version-info-kind {
  color: #a78bfa;
  font-size: 11.5px;
}
.version-info-date {
  margin-left: auto;
  color: #64748b;
  font-size: 11px;
}
.version-info-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10.5px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.version-info-prompt {
  background: rgba(20, 22, 36, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px 0;
  max-height: 250px;
  overflow: auto;
  color: #e2e8f0;
}
.version-info-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}
.version-info-meta a {
  color: #a78bfa;
  text-decoration: none;
}
.version-info-meta a:hover {
  text-decoration: underline;
}

/* ========== Completeness Bot panel ========== */
.cb-panel {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 0;
  margin-top: 20px;
  overflow: hidden;
}
.cb-loading {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}
.cb-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
}
.cb-err {
  padding: 16px;
  color: #f87171;
  background: #240a0a;
  border-radius: 8px;
  margin: 12px;
}

.cb-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid;
  border-bottom-color: transparent;
  gap: 16px;
  flex-wrap: wrap;
}
.cb-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cb-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #0a0e1a;
}
.cb-hero-text {
  display: flex;
  flex-direction: column;
}
.cb-hero-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.cb-hero-sub {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 2px;
}

.cb-hero-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.cb-stats {
  display: flex;
  gap: 14px;
}
.cb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}
.cb-stat small {
  font-weight: 400;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  color: #64748b;
}

.cb-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.cb-btn:hover {
  background: #334155;
}
.cb-btn-primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}
.cb-btn-primary:hover {
  background: #1d4ed8;
}

.cb-meta {
  padding: 10px 24px;
  background: #0a1426;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}
.cb-meta b {
  color: #cbd5e1;
}
.cb-meta-sep {
  opacity: 0.4;
}
.cb-hist {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cb-hist-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  cursor: help;
}

.cb-section-title {
  padding: 16px 24px 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 600;
}

.cb-finding {
  margin: 8px 16px;
  padding: 14px 16px;
  border-left: 4px solid;
  border-radius: 6px;
}
.cb-finding-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cb-finding-icon {
  font-size: 18px;
  font-weight: 900;
  width: 24px;
  text-align: center;
}
.cb-finding-title {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  flex: 1;
}
.cb-finding-sev {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  font-weight: 600;
}
.cb-finding-msg {
  margin-top: 6px;
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.5;
}
.cb-evidence {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 12px;
  color: #94a3b8;
}
.cb-evidence-item {
  padding: 2px 0;
  line-height: 1.4;
  word-break: break-all;
}
.cb-evidence-more {
  padding-top: 4px;
  opacity: 0.6;
  font-style: italic;
}
.cb-fix {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #86efac;
  line-height: 1.5;
}
.cb-fix-label {
  font-weight: 600;
}

.cb-oks {
  margin: 16px;
  background: #0a1426;
  border: 1px solid #1e293b;
  border-radius: 8px;
}
.cb-oks summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  color: #86efac;
  font-weight: 500;
  user-select: none;
}
.cb-oks summary:hover {
  background: #0f1d35;
}
.cb-oks[open] summary {
  border-bottom: 1px solid #1e293b;
}
.cb-oks-grid {
  padding: 8px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cb-ok-row {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
}
.cb-ok-check {
  color: #22c55e;
  font-weight: bold;
  margin-right: 6px;
}
.cb-ok-msg {
  color: #94a3b8;
}

/* Card-side mini badge — improvements */
.completeness-badge {
  transition: all 0.15s;
  cursor: help;
}
.completeness-badge:hover {
  transform: scale(1.05);
}

/* ========== Completeness panel polish v2 ========== */
.cb-fix-btn {
  display: inline-block;
  margin-left: 8px;
  padding: 5px 12px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.cb-fix-btn:hover {
  background: #15803d;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

/* Finding title should NOT show the underscored ID — keep clean */
.cb-finding-title {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

/* Better hero */
.cb-hero-title {
  letter-spacing: -0.01em;
}
.cb-stats {
  padding-right: 16px;
  border-right: 1px solid #1e293b;
}

/* History dots — bigger, with separation */
.cb-hist {
  padding: 2px 0;
}
.cb-hist-dot {
  width: 12px;
  height: 12px;
  margin-right: 3px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Findings list — better spacing */
.cb-finding {
  margin: 10px 18px;
  padding: 16px 18px;
  border-left-width: 5px;
}
.cb-finding-head {
  margin-bottom: 4px;
}
.cb-finding-title {
  font-size: 16px;
  font-weight: 700;
}
.cb-finding-sev {
  font-size: 10.5px;
  padding: 4px 9px;
}

/* Fix hint card — more visible */
.cb-fix {
  padding: 12px 14px;
  line-height: 1.55;
}
.cb-fix-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #4ade80;
}

/* ===== PIN-MODE-WIRED-V1 ===== */
/* Figma-style numbered pins on the photoshop canvas. */
#photoshop-pin-layer {
  cursor: crosshair;
}
.photoshop-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -28px; /* anchor at the tip of the teardrop */
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
  user-select: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  transition: transform 0.12s ease;
}
.photoshop-pin:hover {
  transform: scale(1.12);
}
.photoshop-pin-shape {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
  border: 2px solid #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photoshop-pin-num {
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transform: rotate(45deg);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  line-height: 1;
}
.photoshop-pin.active .photoshop-pin-shape {
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #7c3aed 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(168, 85, 247, 0.25);
}
.photoshop-pin-popover {
  position: absolute;
  z-index: 20;
  width: 280px;
  background: rgba(20, 20, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}
.photoshop-pin-popover::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 18px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
}
.photoshop-pin-popover textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px;
  color: #e5e7eb;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.photoshop-pin-popover textarea:focus {
  border-color: #a78bfa;
}
.photoshop-pin-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.photoshop-pin-popover-head .pin-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.photoshop-pin-popover-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}
.photoshop-pin-popover-actions button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.photoshop-pin-popover-actions .pin-save {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #064e3b;
  border: 0;
}
.photoshop-pin-popover-actions .pin-delete {
  color: #fca5a5;
}
.photoshop-pin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 8px;
}
.photoshop-pin-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px;
}
.photoshop-pin-row .pin-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.photoshop-pin-row textarea {
  flex: 1;
  min-height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 5px 7px;
  color: #d1d5db;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}
.photoshop-pin-row textarea:focus {
  border-color: #a78bfa;
}
.photoshop-pin-row .pin-row-del {
  background: transparent;
  border: 0;
  color: #fca5a5;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.photoshop-pin-row .pin-row-jump {
  background: transparent;
  border: 0;
  color: #a7f3d0;
  cursor: pointer;
  font-size: 13px;
  margin-right: 2px;
}
.photoshop-queue-item-kind.pin {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
}

/* === VERSION-SYNC-WIRED-V1 === */
/* OD-side version chip — distinct from DB chips (purple) with an orange
 * gradient to signal "history from the OD daemon", not from this UI. */
.version-chip[data-source="od"] {
  background: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.15),
    rgba(234, 88, 12, 0.18)
  );
  border-color: rgba(251, 146, 60, 0.4);
  color: #fed7aa;
  position: relative;
}
.version-chip[data-source="od"]::before {
  content: "🟠";
  font-size: 9px;
  margin-right: 3px;
  opacity: 0.8;
}
.version-chip[data-source="od"][data-has-write="0"] {
  opacity: 0.55;
  cursor: help;
  text-decoration: line-through;
}
.version-chip[data-source="od"]:hover {
  background: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.3),
    rgba(234, 88, 12, 0.35)
  );
  border-color: rgba(251, 146, 60, 0.7);
  color: #fff;
}
.version-chip[data-source="od"].active {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.25);
}

/* ───────────── MARKETING-EVAL-V1 — блок «Оценить» под iPhone-превью ───────────── */
.screen-eval {
  position: relative;
  margin-top: 10px;
  padding: 10px 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* FIXED-HEIGHT: одинаковая высота у всех карточек → превью на одном уровне,
     и блок не растёт/не двигает экран при раскрытии «Подробнее» или анимации.
     245px вмещает оценку + «Подробнее» + поле + два ряда кнопок без обрезки. */
  height: 245px;
  box-sizing: border-box;
}
/* Скролл-тело: оценка/подробнее/история листаются ВНУТРИ, не меняя высоту блока
   и не перекрывая превью. Кнопки и поле комментария остаются на месте снизу. */
.screen-eval-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.screen-eval-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.screen-eval-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.screen-eval-attempts {
  font-size: 11px;
  color: #64748b;
}
/* Плейсхолдер оценки для EXTRA-экранов — та же высота (из .screen-eval), сообщение
   по центру, чтобы их превью было на одном уровне с остальными. */
.screen-eval-na {
  justify-content: flex-start;
}
.screen-eval-na-msg {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 0 8px;
}
.screen-eval-latest:empty {
  display: none;
}
.eval-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.eval-badge {
  font-size: 14px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 8px;
  color: #fff;
}
.eval-badge-pass {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
.eval-badge-fail {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}
.eval-verdict {
  font-size: 12px;
  font-weight: 600;
}
.eval-verdict.eval-ok {
  color: #16a34a;
}
.eval-verdict.eval-low {
  color: #ea580c;
}
.eval-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.eval-pill-run {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}
.eval-pill-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.eval-detail-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  color: #7c3aed;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
/* APPLY-MANUAL-V1 — «Применить правки в OD»: зелёный CTA в ряду действий рядом с
   «Оценить». Зелёный = действие подтверждения/применения (отлично от фиолетовой
   «Оценить»), чтобы пользователю было логично и не конфликтовало визуально. */
.eval-apply-btn {
  flex: 1 1 150px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    opacity 0.1s ease;
}
.eval-apply-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.42);
}
.eval-apply-btn[hidden] {
  display: none;
}
.eval-apply-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.eval-detail-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0;
  font-family: inherit;
}
/* MARKETING-EVAL-ANIM — мягкая чистая анимация-оверлей поверх блока оценки
   (📸 снимок → 🚀 отправка → 🧠 анализ). Не сдвигает и не перекрывает превью. */
.screen-eval-progress {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}
.screen-eval-progress[hidden] {
  display: none;
}
.screen-eval-anim {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-eval-anim-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid #a855f7;
  opacity: 0;
  animation: evalRing 1.8s ease-out infinite;
}
.screen-eval-anim-ring.r2 {
  animation-delay: 0.9s;
  border-color: #22d3ee;
}
@keyframes evalRing {
  0% {
    transform: scale(0.55);
    opacity: 0.7;
  }
  80% {
    opacity: 0;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
.screen-eval-stage-icon {
  position: relative;
  z-index: 2;
  font-size: 30px;
  line-height: 1;
  animation: evalBob 1.5s ease-in-out infinite;
}
@keyframes evalBob {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.1);
  }
}
.screen-eval-progress.stage-send .screen-eval-stage-icon {
  animation: evalFly 1.1s cubic-bezier(0.5, 0.1, 0.3, 1) infinite;
}
@keyframes evalFly {
  0% {
    transform: translate(-14px, 6px) rotate(-12deg);
    opacity: 0.2;
  }
  45% {
    opacity: 1;
  }
  100% {
    transform: translate(16px, -10px) rotate(12deg);
    opacity: 0;
  }
}
.screen-eval-progress.stage-send .screen-eval-anim-ring {
  border-color: #22d3ee;
}
.screen-eval-progress.stage-think .screen-eval-anim-ring {
  border-color: #7c3aed;
}
.screen-eval-bar {
  width: 72%;
  height: 5px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.screen-eval-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #c084fc, #22d3ee);
  background-size: 200% 100%;
  animation:
    evalIndet 1.3s ease-in-out infinite,
    evalShimmer 1.6s linear infinite;
}
@keyframes evalIndet {
  0% {
    margin-left: -40%;
  }
  100% {
    margin-left: 100%;
  }
}
@keyframes evalShimmer {
  to {
    background-position: 200% 0;
  }
}
.screen-eval-progress-label {
  font-size: 12px;
  color: #7c3aed;
  font-weight: 700;
  text-align: center;
}
.screen-eval-comment {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  font-size: 12px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
}
.screen-eval-comment.eval-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.screen-eval-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.screen-eval-btn {
  flex: 1 1 130px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    opacity 0.1s ease;
}
.screen-eval-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.screen-eval-btn:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}
/* «Предыдущие оценки» — вторичное действие, на отдельной строке во всю ширину. */
.screen-eval-history-btn {
  flex: 1 1 100%;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.screen-eval-history-btn[hidden] {
  display: none;
}
.screen-eval-history-btn:hover {
  background: #f8fafc;
}
.screen-eval-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eval-hist-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.eval-hist-meta {
  font-size: 11px;
  color: #64748b;
}
.eval-hist-sugg {
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
}
.eval-hist-empty {
  font-size: 12px;
  color: #94a3b8;
}

/* MARKETING-EVAL-V3 — toggle + axes */
.screen-eval-provider {
  display: inline-flex;
  border: 1px solid #d8b4fe;
  border-radius: 7px;
  overflow: hidden;
  margin-left: auto;
}
.eval-prov-btn {
  border: none;
  background: #fff;
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  cursor: pointer;
}
.eval-prov-btn + .eval-prov-btn {
  border-left: 1px solid #e9d5ff;
}
.eval-prov-btn.active {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
}
.screen-eval-scores {
  display: flex;
  gap: 8px;
  margin: 6px 0 4px;
}
.eval-axis {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 6px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.eval-axis-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.eval-axis-val {
  font-size: 15px;
  font-weight: 800;
  color: #334155;
}
.eval-axis.axis-pass {
  background: #dcfce7;
  border-color: #86efac;
}
.eval-axis.axis-pass .eval-axis-val {
  color: #15803d;
}
.eval-axis.axis-fail {
  background: #fef2f2;
  border-color: #fecaca;
}
.eval-axis.axis-fail .eval-axis-val {
  color: #b91c1c;
}
.eval-stop-btn {
  flex: 1 1 130px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.eval-stop-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.eval-stop-btn[hidden] {
  display: none;
}
.eval-start-btn[hidden] {
  display: none;
}

/* ── USER-MANAGEMENT-V1 — admin access panel ── */
.users-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}
.users-modal-backdrop[hidden] {
  display: none;
}
.users-modal {
  width: 100%;
  max-width: 760px;
  background: #11131c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.users-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.users-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.users-modal-sub {
  font-size: 12.5px;
  color: #8a93a6;
  margin-top: 4px;
}
.user-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.user-add-form input,
.user-add-form select {
  flex: 1;
  min-width: 130px;
  padding: 9px 12px;
  background: #0a0c14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e8ebf2;
  font-size: 13px;
  font-family: inherit;
}
.user-add-form .primary-btn {
  flex: 0 0 auto;
}
.users-msg {
  font-size: 12.5px;
  min-height: 18px;
  margin-bottom: 8px;
}
.users-msg.ok {
  color: #86efac;
}
.users-msg.err {
  color: #f87171;
}
.users-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.users-table th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: #8a93a6;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.users-table td {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #e8ebf2;
}
.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.role-badge.approver {
  background: rgba(124, 58, 237, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(124, 58, 237, 0.4);
}
.role-badge.moderator {
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.4);
}
.role-badge.viewer {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.role-badge.admin-tag {
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #1a1200;
  border: 0;
  margin-left: 6px;
}
.user-pass {
  font-family: ui-monospace, Menlo, monospace;
  color: #9aa4b5;
  font-size: 12px;
}
.user-del-btn {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  font-size: 12px;
  cursor: pointer;
}
.user-del-btn:hover {
  background: rgba(248, 113, 113, 0.2);
}
.user-del-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* EVAL-DETAIL-EXPAND-FIX — при раскрытии «Подробнее» карточка оценки растёт,
   чтобы фидбэк маркетолога был виден целиком (по умолчанию .screen-eval имеет
   фикс. высоту 245px + overflow-y:auto в body, из-за чего раскрытый блок прятался). */
.screen-eval.eval-expanded {
  height: auto !important;
  min-height: 0 !important;
}
.screen-eval.eval-expanded .screen-eval-body {
  overflow-y: visible !important;
}
.screen-eval-detail {
  max-height: 360px;
  overflow-y: auto;
}


/* ── VIDEO-CLONE: плавающий плеер ──────────────────────────────────── */
.video-chip {
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.6));
}
.video-chip:hover { transform: scale(1.15); }
.fv-box {
  position: fixed;
  top: 84px;
  left: calc(100vw - 364px);
  width: 332px;
  z-index: 99999;
  background: #16121f;
  border: 1px solid rgba(124, 58, 237, 0.5);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.fv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.35), rgba(192, 38, 211, 0.25));
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.fv-head:active { cursor: grabbing; }
.fv-title { font-size: 12px; font-weight: 600; color: #e9e3ff; }
.fv-btn {
  background: transparent;
  border: 0;
  color: #cfc7e6;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 7px;
}
.fv-btn:hover { color: #fff; }
.fv-body video {
  display: block;
  width: 100%;
  max-height: 62vh;
  background: #000;
}
.fv-pill {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(124, 58, 237, 0.45);
}


/* ═══ IFRAME-REPLAY-OVERLAY + COMPETITOR-PLAY (2026-06-11) ═══ */
.iframe-replay-overlay {
  /* FIX 2026-06-11: кнопка СБОКУ от экрана (не поверх контента) + контраст
     (тёмная полупрозрачная сливалась с тёмными экранами) */
  position: static;
  display: flex;
  margin: 0 0 6px auto;
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.65);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  transition: opacity 0.15s, transform 0.2s;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}
.iframe-shell:hover .iframe-replay-overlay {
  opacity: 1;
}
/* shell: кнопка ⟳ — тонкой строкой НАД экраном, прижата вправо.
   Не сбоку (сжимало экран) и не внутри .iframe-wrap (overflow её резал). */
.iframe-shell {
  position: relative;
}
.iframe-replay-overlay:hover {
  transform: rotate(45deg);
}
.competitor-play-btn {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ede9fe;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.competitor-play-btn:hover {
  filter: brightness(1.12);
}

/* HARD-FIX 2026-06-20: средний слот превью схлопывался в ниточку (карточка/обёртка
   iPhone-iframe сжималась ниже нормы по неизвестной рантайм-причине). Жёстко не даём
   ни карточке, ни iPhone-обёртке сжиматься — переопределяет причину через !important. */
.screens-grid > .screen-card { flex: 0 0 410px !important; width: 410px !important; min-width: 410px !important; }
.device-block.iphone-html { width: 100% !important; min-width: 0 !important; }
.device-block.iphone-html .iframe-shell { width: 100% !important; min-width: 360px !important; }
.device-block.iphone-html .iframe-wrap { width: 100% !important; min-width: 360px !important; }
@media (max-width: 760px){
  .screens-grid > .screen-card { flex: 0 0 calc(100vw - 28px) !important; width: calc(100vw - 28px) !important; min-width: 0 !important; }
  .device-block.iphone-html .iframe-shell, .device-block.iphone-html .iframe-wrap { min-width: 0 !important; }
}

/* HARD-FIX-2 2026-06-20: ниточку даёт залипший JS-масштаб iframe (--iphone-scale в полу 0.05).
   Жёстко фиксируем масштаб iPhone-превью — JS-инлайн (без !important) проигрывает этому. */
.device-block.iphone-html .iframe-wrap iframe {
  width: 390px !important;
  height: 844px !important;
  transform: scale(0.978) !important;
  transform-origin: top left !important;
}
@media (max-width: 760px){
  .device-block.iphone-html .iframe-wrap iframe { transform: scale(calc((100vw - 56px)/390)) !important; }
}


/* hubfix-20260706: поиск по проектам */
.proj-search {
  flex: 1;
  max-width: 360px;
  margin-left: 18px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #e8e8f0;
  font-size: 13px;
  outline: none;
}
.proj-search:focus {
  border-color: rgba(124, 58, 237, 0.65);
  background: rgba(124, 58, 237, 0.14);
}
.proj-search::placeholder { color: #8a8aa0; }
