/* Presentation edition 8.0 */
:root {
  --signal: #ff4d2f;
  --deep: #0d0d0f;
  --warm-paper: #f2efe8;
}

.presentation-launch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--signal) !important;
  border-color: var(--signal) !important;
  font-weight: 700;
}

.presentation-launch:hover {
  background: var(--deep) !important;
  border-color: var(--deep) !important;
}

.scenario-launch {
  font-weight: 700;
}

.control-irrelevant {
  display: none !important;
}

label.is-locked {
  position: relative;
}

label.is-locked::after {
  content: "зафиксировано для формы";
  display: block;
  margin-top: 5px;
  color: #7b7c77;
  font-size: 9px;
}

label.is-locked select {
  opacity: 0.64;
}

.live-metrics {
  position: absolute;
  z-index: 2;
  top: 112px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  width: min(620px, calc(100% - 36px));
  border: 1px solid rgba(13, 13, 15, 0.18);
  background: rgba(242, 239, 232, 0.92);
  box-shadow: 0 10px 30px rgba(13, 13, 15, 0.06);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.live-metrics article {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid rgba(13, 13, 15, 0.14);
}

.live-metrics article:last-child {
  border-right: 0;
}

.live-metrics span {
  display: block;
  overflow: hidden;
  color: #6d706c;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-metrics strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--deep);
  font: 500 13px "Arial Narrow", Arial, sans-serif, Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#liveStatus {
  font: 700 11px Arial, sans-serif;
  text-transform: uppercase;
}

#liveStatus i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #3d8f58;
  box-shadow: 0 0 0 3px rgba(61, 143, 88, 0.12);
}

.decision-chain {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 58px;
  max-width: min(760px, calc(100% - 36px));
  padding: 10px 13px 11px;
  border: 1px solid rgba(13, 13, 15, 0.16);
  background: rgba(242, 239, 232, 0.92);
  backdrop-filter: blur(9px);
  pointer-events: none;
}

.decision-chain span {
  display: block;
  margin-bottom: 4px;
  color: #70726e;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.decision-chain strong {
  display: block;
  overflow: hidden;
  color: var(--deep);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.workspace:has(#drawingCanvas:not(.hidden)) .live-metrics,
.workspace:has(#drawingCanvas:not(.hidden)) .decision-chain {
  display: none;
}

.sheet-export {
  border-color: var(--signal) !important;
  background: #fff5f1 !important;
}

.sheet-export b {
  color: var(--signal);
}

.sheet-export:disabled {
  cursor: wait;
  opacity: 0.65;
}

.scenario-dialog {
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
}

.scenario-dialog::backdrop {
  background: rgba(13, 13, 15, 0.76);
  backdrop-filter: blur(8px);
}

.scenario-card {
  width: 100%;
  padding: clamp(28px, 4vw, 56px);
  border: 1px solid rgba(13, 13, 15, 0.2);
  background: var(--warm-paper);
}

.scenario-heading {
  max-width: 720px;
}

.scenario-heading h2 {
  margin: 8px 0 14px;
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: -0.045em;
}

.scenario-heading p {
  margin: 0;
  color: #5d5f5b;
  line-height: 1.55;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 36px;
}

.scenario-grid button {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid rgba(13, 13, 15, 0.22);
  background: #f9f7f1;
  color: var(--deep);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.scenario-grid button:hover {
  transform: translateY(-3px);
  border-color: var(--deep);
  background: white;
}

.scenario-grid button > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 36px;
  background: var(--deep);
  color: white;
  font: 500 11px "Arial Narrow", Arial, sans-serif, Arial, sans-serif;
}

.scenario-grid b {
  font: 600 18px "Arial Narrow", Arial, sans-serif, Arial, sans-serif;
  line-height: 1.2;
}

.scenario-grid small {
  margin-top: 10px;
  color: #686a66;
  font-size: 12px;
  line-height: 1.5;
}

.scenario-grid em {
  margin-top: auto;
  padding-top: 26px;
  color: var(--signal);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.scenario-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(13, 13, 15, 0.2);
}

.scenario-footer span {
  max-width: 720px;
  color: #686a66;
  font-size: 10px;
  line-height: 1.45;
}

.scenario-footer button {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid rgba(13, 13, 15, 0.24);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.presentation-guide {
  position: absolute;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 142px;
  padding: 24px;
  border-top: 5px solid var(--signal);
  background: rgba(13, 13, 15, 0.93);
  color: white;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.presentation-progress {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: center;
}

.presentation-progress i {
  width: 28px;
  height: 3px;
  background: rgba(255, 255, 255, 0.26);
}

.presentation-progress i.active {
  background: var(--signal);
}

.presentation-copy {
  min-width: 0;
}

.presentation-copy > span {
  color: #aeb0aa;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.presentation-copy h2 {
  margin: 5px 0 7px;
  color: white;
  font-size: clamp(18px, 2.1vw, 28px);
  letter-spacing: -0.03em;
}

.presentation-copy p {
  max-width: 850px;
  margin: 0;
  color: #c9cbc5;
  font-size: 12px;
  line-height: 1.5;
}

.presentation-controls {
  display: flex;
  gap: 7px;
  align-items: stretch;
}

.presentation-controls button {
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: white;
  cursor: pointer;
}

.presentation-controls button:disabled {
  cursor: default;
  opacity: 0.25;
}

#presentationNext {
  display: inline-flex;
  min-width: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 16px;
  border-color: var(--signal);
  background: var(--signal);
  font-weight: 800;
}

#presentationExit {
  font-size: 24px;
}

.app-toast {
  position: fixed;
  z-index: 100;
  top: 94px;
  left: 50%;
  padding: 11px 16px;
  transform: translate(-50%, -12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(13, 13, 15, 0.92);
  color: white;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.app-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

body.presentation-mode .app-shell {
  grid-template-columns: 1fr;
}

body.presentation-mode .sidebar {
  display: none;
}

body.presentation-mode .top-actions {
  display: none;
}

body.presentation-mode .workspace {
  height: 100%;
}

body.presentation-mode .live-metrics {
  top: 66px;
}

body.presentation-mode .decision-chain,
body.presentation-mode .legend,
body.presentation-mode .help {
  display: none;
}

body.presentation-mode .view-toolbar {
  right: 18px;
  left: 18px;
}

body.presentation-mode .scene-info {
  display: flex;
}

@media (max-width: 1320px) {
  .top-actions {
    gap: 5px;
  }

  .top-actions button {
    padding-right: 10px;
    padding-left: 10px;
    font-size: 10px;
  }

  .live-metrics {
    width: min(520px, calc(100% - 36px));
  }

  .live-metrics article {
    padding-right: 9px;
    padding-left: 9px;
  }
}

@media (max-width: 1100px) {
  .live-metrics {
    top: 148px;
    grid-template-columns: repeat(2, 1fr);
    width: 310px;
  }

  .live-metrics article:nth-child(2) {
    border-right: 0;
  }

  .live-metrics article:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(13, 13, 15, 0.14);
  }

  .presentation-guide {
    grid-template-columns: 1fr auto;
  }

  .presentation-progress {
    display: none;
  }
}

@media (max-width: 900px) {
  #btnSave,
  #btnReset {
    display: none;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .scenario-grid button {
    min-height: 180px;
  }

  .scenario-grid button > span {
    margin-bottom: 22px;
  }
}

@media (max-width: 720px) {
  .presentation-launch {
    display: inline-flex !important;
  }

  .live-metrics,
  .decision-chain {
    display: none;
  }

  .presentation-guide {
    right: 8px;
    bottom: 8px;
    left: 8px;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .presentation-copy p {
    font-size: 10px;
  }

  .presentation-controls {
    min-height: 42px;
  }

  #presentationNext {
    flex: 1;
  }

  .scenario-dialog {
    width: calc(100vw - 18px);
  }

  .scenario-card {
    max-height: calc(100vh - 18px);
    overflow: auto;
  }

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