/* ===== Guide panel (split-screen documentation) ===== */

#demo-shell {
  display: flex;
  align-items: flex-start;
}

/* Panel inner content — kept at a fixed width so it doesn't reflow while the
   panel collapses; overflow on the panel clips it during the slide. */
#guide-panel-inner {
  width: 372px;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
}

.guide-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.guide-summary {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text-primary);
}
.guide-summary.guide-fallback {
  font-weight: 500;
  color: var(--color-text-secondary);
}
.guide-sections {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.guide-section {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}
.guide-section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--volet-500);
  margin-bottom: 6px;
}
.guide-section-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

/* Toggle button — reuses the shared "info" icon */
#guide-toggle {
  position: fixed;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--volet-400), var(--volet-600));
  color: #fff;
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--motion-fast) var(--ease-out);
}
#guide-toggle:active { transform: scale(0.92); }
#guide-toggle svg { width: 26px; height: 26px; }

#guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-base) var(--ease-out);
}

/* ========== Desktop: real two-column split ========== */
@media (min-width: 1024px) {
  #guide-panel {
    width: 0;
    max-height: 852px;
    margin-left: 0;
    overflow: hidden;
    background: var(--color-surface);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-float);
    opacity: 0;
    transition: width var(--motion-slow) var(--ease-out),
                margin-left var(--motion-slow) var(--ease-out),
                opacity var(--motion-base) var(--ease-out);
  }
  #guide-panel-inner {
    max-height: 852px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  body.guide-open #guide-panel {
    width: 420px;
    margin-left: 24px;
    opacity: 1;
  }
  #guide-toggle {
    top: 28px;
    right: 28px;
  }
  /* Backdrop never used on desktop */
  #guide-backdrop { display: none; }
}

/* ========== Mobile / narrow: slide-in drawer ========== */
@media (max-width: 1023px) {
  #guide-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(85vw, 380px);
    z-index: 160;
    background: var(--color-surface);
    box-shadow: var(--shadow-sheet);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--motion-slow) var(--ease-out);
  }
  body.guide-open #guide-panel {
    transform: translateX(0);
  }
  body.guide-open #guide-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  #guide-toggle {
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}
