/* Shared layout for Beast demos — mock panel + plaque overlay */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12pt;
  background-color: #e5e5e5;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
}

.demo-page-wrap {
  margin: 0 12px;
  width: 100%;
  max-width: 960px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 600px) {
  .demo-page-wrap {
    margin: 0;
    max-width: none;
  }
}

.demo-back {
  padding: 8px 12px;
  font-size: 10pt;
  border-bottom: 1px solid #ddd;
  background: #f5f5f5;
}

.demo-back a {
  color: #1565C0;
}

.demo-mock-area {
  flex: 1 1 auto;
  padding: 12px;
  position: relative;
}

/* Plaque overlay — above mock UI but below arrows (arrows z-index 10050) */
#demoPlaque {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 520px;
  max-height: 42vh;
  overflow: auto;
  z-index: 10040;
  background: #fffef5;
  border: 2px solid #c9a227;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
}

#demoPlaqueTitle {
  font-weight: bold;
  font-size: 13pt;
  margin-bottom: 8px;
  color: #333;
}

#demoPlaqueBody {
  font-size: 12pt;
  line-height: 1.45;
  color: #222;
}

.demo-start-hint {
  margin: 0;
}

#demoPlaqueBody p {
  margin: 0 0 8px 0;
}

.demo-plaque-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-auto-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-auto-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #888;
  background: #fff;
  cursor: pointer;
  color: #1565c0;
  flex-shrink: 0;
}

.demo-auto-toggle:hover {
  background: #e3f2fd;
}

.demo-auto-toggle[aria-pressed="true"] {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #1b5e20;
}

.demo-speed-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  max-width: 220px;
}

.demo-speed-caption {
  font-size: 8pt;
  color: #555;
  line-height: 1.2;
}

.demo-speed-label {
  font-weight: bold;
}

.demo-speed-hint {
  color: #1565c0;
}

#demoSpeedRange {
  width: 100%;
  min-width: 120px;
}

@media (max-width: 520px) {
  .demo-speed-block {
    min-width: 100px;
    width: 100%;
  }
}

#demoNextBtn {
  padding: 6px 16px;
  font-size: 10pt;
  border-radius: 6px;
  border: 1px solid #888;
  background: #f0f7ff;
  cursor: pointer;
}

#demoNextBtn:hover {
  background: #e3f2fd;
}

#demoProgress {
  margin-right: auto;
  font-size: 9pt;
  color: #666;
  flex-shrink: 0;
}

/* Reuse Beast-like tokens */
.beast-root-mock {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
}

.beast-top-bar-mock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  min-height: 36px;
  border-bottom: 1px solid #eee;
}

.beast-pulse-circle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #00aa00;
  box-shadow: 0 0 4px rgba(0, 170, 0, 0.8);
  transition: background-color 0.2s ease;
}

.beast-pulse-circle.off {
  background-color: #006600;
  box-shadow: none;
}

.mock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.mock-label {
  font-size: 9pt;
  color: #555;
  width: 100%;
}

.mock-btn {
  padding: 4px 10px;
  font-size: 10pt;
  border: 1px solid #888;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
}

.mock-btn:hover {
  background: #e8e8e8;
}

.mock-btn.active {
  background: #c8e6c9;
  border-color: #2e7d32;
}

.basic-context-indicator {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 9pt;
  background: #d8d8d8;
}

.basic-context-indicator.active {
  background: #b8e8b8;
  box-shadow: 0 0 8px rgba(0, 200, 80, 0.5);
}

.mock-ep-bar {
  margin-top: 12px;
  padding: 8px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 9pt;
}

.ep-waiting-progress-wrap {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.ep-waiting-progress-fill {
  height: 100%;
  width: 0%;
  background: #1976d2;
  transition: width 0.4s ease;
}

/* Demo 01 — fragments aligned with index.html */
.perception-tree-active-branch {
  border: 1px solid #DDD700;
  background-color: #FFFFE1;
  padding: 6px 10px;
  font-size: 10pt;
  margin-top: 8px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pt-branch-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.info-picture {
  margin-top: 8px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  padding: 6px 8px;
  font-size: 9pt;
  box-sizing: border-box;
}

.info-picture-title {
  font-size: 9pt;
  font-weight: bold;
  margin-bottom: 4px;
}

.info-picture-row {
  display: flex;
  flex-direction: row;
  gap: 4px;
  margin-bottom: 4px;
}

.info-cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid #ddd;
  background-color: #ffffff;
  text-align: center;
  box-sizing: border-box;
  font-size: 8pt;
}

.info-cell-active {
  background-color: #FFF9C4;
}

.beast-activity-wrapper {
  margin-top: 10px;
}

.beast-activity-title {
  font-size: 10pt;
  margin-bottom: 4px;
}

.beast-activity-block {
  min-height: 44px;
  width: 100%;
  background-color: #eeeeee;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 10pt;
  line-height: 1.35;
}

body.demo01-sleep,
html.demo01-sleep body {
  background-color: #e8e8e8 !important;
}

.demo-page-wrap.demo01-sleep-wrap {
  background: #ececec;
}

.stimul-btn-sleep-locked {
  opacity: 0.42 !important;
  pointer-events: none;
  cursor: not-allowed !important;
}

/* Длинный макет: страница прокручивается, нижний блок можно поднять над фиксированной плашкой */
html.demo-scroll-page {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

html.demo-scroll-page body.demo-scroll-page {
  display: block;
  height: auto !important;
  min-height: 100vh;
}

html.demo-scroll-page .demo-page-wrap.demo-scroll-pad {
  min-height: 100vh;
  padding-bottom: max(46vh, 200px);
}

html.demo-scroll-page .demo-page-wrap .demo-mock-area {
  flex: 0 0 auto;
}
