/* ═══════════════════════════════════════════════════════════════════════
   FAQ-Ways of Working slide-out drawer (2026-08-17)
   Built per Harding's ask: the 16 sidebar deep-links under "GS4D
   FAQ-Ways of Working" used to navigate away to tazzogram.com/#section. Now
   they open this in-app panel instead, so a visitor mid-diagram never
   loses their tab/session to go read documentation. tazzogram.com itself is
   being stripped down separately (video + Register/Sign In only, per
   Harding -- "not giving the secret sauce to casual visitors who
   haven't even logged in yet") -- this drawer is the ONLY place this
   content lives going forward, restricted to people already inside the
   app (same "already cleared the gate" reasoning as the 2026-08-16
   sidebar swap that removed Register/Sign In from sampler.tazzogram.com).
   Overlay, not push-layout: the panel floats on top of the diagram
   canvas. Closing it leaves the diagram/editor exactly as it was,
   nothing reflows.
   Colors are hardcoded, matching the same palette as gs4d-landing's
   guide content this was migrated from (#185FA5 blue, #1D9E75 teal,
   #BA7517 amber, #1a1a18 ink, #f5f4f0 surface) -- no CSS variables here,
   per this project's standing rule.

   2026-08-18 UPDATE, per Harding (verbatim): "Besides the mobility of
   it, I don't want the tone down (or 'smoked/cloudy' effect that the
   sidebar menu goes through once the drawer-like panel is open. There
   is no need... keep it 100% live and vivid." Two changes from the
   original build:
   1. The panel is now freely draggable anywhere on screen (by its
      header), not just resizable-width from a fixed right anchor. See
      js/faq-drawer.js -- position state is separate from the existing
      width state, its own localStorage key, clamped so the header
      always stays at least partly on-screen and grabbable (confirmed
      with Harding: never let it get lost off-screen).
   2. The dimming/backdrop is gone. `.faq-drawer-overlay` still exists
      and still covers the full viewport (so click-outside-to-close
      keeps working exactly as before, confirmed with Harding), it's
      just visually transparent now -- the sidebar and everything else
      stays 100% normal-brightness while the drawer is open.
   ═══════════════════════════════════════════════════════════════════ */
.faq-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: transparent; /* 2026-08-18: was rgba(26,26,24,0.6) -- Harding
     wants zero dimming of the sidebar/app behind the drawer. Element still
     covers the full viewport so click-outside-to-close (faq-drawer.js's
     `if (e.target === overlay) closeDrawer()`) keeps working unchanged. */
  z-index: 9999;
}
.faq-drawer-overlay.open { display: block; }
.faq-drawer-panel {
  /* 2026-08-18: no longer anchored to the right edge (top/right/bottom:0) --
     top/left are now set inline by js/faq-drawer.js so the panel can be
     dragged anywhere. Floating panel needs its own height + rounded
     corners + shadow-all-around now that it's not flush against a viewport
     edge. */
  position: fixed;
  width: 640px;
  /* max-width re-clamped in JS against window.innerWidth on open/resize,
     since vw-based CSS alone can't be read back as a px value for the
     drag-resize math in faq-drawer.js. */
  max-width: 96vw;
  height: 80vh;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.30), 0 0 0 1px rgba(0,0,0,0.08);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 10000;
}
.faq-drawer-overlay.open .faq-drawer-panel { opacity: 1; transform: scale(1); }
/* Draggable resize handle, left edge of the panel -- width only, unchanged
   behavior from the original build (drag left/toward the sidebar to widen). */
.faq-drawer-resize {
  position: absolute; left: -5px; top: 0; bottom: 0; width: 10px;
  cursor: col-resize;
  z-index: 10001;
  touch-action: none;
}
.faq-drawer-resize::after {
  content: ''; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px;
  background: transparent;
}
.faq-drawer-resize:hover::after,
.faq-drawer-resize.dragging::after { background: #185FA5; }
.faq-drawer-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  background: #1c3461;
  cursor: move; /* 2026-08-18: header doubles as the drag-to-move handle */
  touch-action: none;
}
.faq-drawer-header.dragging { cursor: grabbing; }
.faq-drawer-title {
  flex: 1; min-width: 0;
  font-size: 16px; font-weight: 800; color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  user-select: none;
}
.faq-drawer-close {
  background: none; border: none; color: rgba(255,255,255,0.85);
  font-size: 20px; line-height: 1; cursor: pointer;
  padding: 6px 8px; border-radius: 6px; flex-shrink: 0;
}
.faq-drawer-close:hover { background: rgba(255,255,255,0.14); color: #ffffff; }
.faq-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 8px 36px 70px;
}
.faq-drawer-body::-webkit-scrollbar { width: 9px; }
.faq-drawer-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 5px; }
/* ── Content typography, migrated from gs4d-landing/index.html's inline
   <style>, scoped under .faq-drawer-body so nothing here can leak onto
   or collide with the rest of app.css. Same class names the templates
   already use (.cutout, .note, .card, .steps, .faq-q, table, etc.) so
   the migrated markup needed zero rewriting. ── */
.faq-drawer-body { color: #1a1a18; line-height: 1.65; font-size: 15.5px; }
.faq-drawer-body section { padding: 22px 0 30px; }
.faq-drawer-body section > h2 {
  font-size: 23px; line-height: 1.25; margin: 0 0 6px; font-weight: 800;
  letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px;
}
.faq-drawer-body section > h2 .h2-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; background: #E6F1FB; color: #185FA5;
}
.faq-drawer-body .section-kicker { color: #6b6a63; font-size: 14px; margin: 0 0 18px; font-weight: 500; }
.faq-drawer-body h3 { font-size: 16.5px; margin: 22px 0 8px; font-weight: 700; }
.faq-drawer-body p { margin: 0 0 13px; }
.faq-drawer-body ul, .faq-drawer-body ol { margin: 0 0 13px; padding-left: 22px; }
.faq-drawer-body li { margin-bottom: 6px; }
.faq-drawer-body strong { font-weight: 700; }
.faq-drawer-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.87em;
  background: #f5f4f0; border: 1px solid rgba(0,0,0,0.10);
  padding: 1px 6px; border-radius: 4px; color: #1a1a18;
}
.faq-drawer-body a { color: #185FA5; }
.faq-drawer-body .cutout {
  background: #f5f4f0; border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px; padding: 16px 16px 12px; margin: 16px 0 20px;
}
.faq-drawer-body .cutout svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.faq-drawer-body .cutout .caption {
  margin: 12px 0 0; font-size: 12.5px; color: #6b6a63; line-height: 1.55;
  text-align: center; font-weight: 500;
}
.faq-drawer-body .cutout .caption b { color: #1a1a18; font-weight: 700; }
.faq-drawer-body .note {
  border-left: 4px solid #185FA5; background: #E6F1FB;
  padding: 13px 16px; border-radius: 0 9px 9px 0; margin: 16px 0;
}
.faq-drawer-body .note.teal { border-left-color: #1D9E75; background: #E1F5EE; }
.faq-drawer-body .note.amber { border-left-color: #BA7517; background: #FAEEDA; }
.faq-drawer-body .note p:last-child { margin-bottom: 0; }
.faq-drawer-body .note .note-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.05em; margin: 0 0 6px; color: #185FA5;
}
.faq-drawer-body .note.teal .note-title { color: #16714f; }
.faq-drawer-body .note.amber .note-title { color: #8a5610; }
.faq-drawer-body .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 20px; }
.faq-drawer-body .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0 20px; }
.faq-drawer-body .card {
  border: 1px solid rgba(0,0,0,0.12); border-radius: 11px; padding: 16px;
  background: #ffffff;
}
.faq-drawer-body .card h4 {
  margin: 0 0 8px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.faq-drawer-body .card p { font-size: 13.5px; color: #4a4a45; margin: 0 0 8px; }
.faq-drawer-body .card p:last-child { margin-bottom: 0; }
.faq-drawer-body .card ul { font-size: 13.5px; color: #4a4a45; margin-bottom: 0; }
.faq-drawer-body .card .badge-dot {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.faq-drawer-body .card.blue .badge-dot { background: #E6F1FB; color: #185FA5; }
.faq-drawer-body .card.teal .badge-dot { background: #E1F5EE; color: #1D9E75; }
.faq-drawer-body .card.amber .badge-dot { background: #FAEEDA; color: #BA7517; }
.faq-drawer-body table {
  width: 100%; border-collapse: collapse; margin: 16px 0 20px;
  font-size: 14px; border: 1px solid rgba(0,0,0,0.12); border-radius: 10px; overflow: hidden;
}
.faq-drawer-body th {
  background: #1c3461; color: #ffffff; text-align: left;
  padding: 10px 13px; font-weight: 700; font-size: 13px;
}
.faq-drawer-body td { padding: 10px 13px; border-top: 1px solid rgba(0,0,0,0.10); vertical-align: top; }
.faq-drawer-body tbody tr:nth-child(even) { background: #faf9f6; }
.faq-drawer-body td code { font-size: 12px; }
.faq-drawer-body .steps { list-style: none; padding: 0; counter-reset: step; margin: 16px 0 20px; }
.faq-drawer-body .steps > li {
  position: relative; padding: 0 0 16px 44px; counter-increment: step;
  border-left: 2px solid rgba(0,0,0,0.10); margin-left: 14px;
}
.faq-drawer-body .steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.faq-drawer-body .steps > li::before {
  content: counter(step);
  position: absolute; left: -15px; top: -2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #185FA5; color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.faq-drawer-body .steps > li h4 { margin: 3px 0 5px; font-size: 15px; font-weight: 700; }
.faq-drawer-body .steps > li p { font-size: 13.5px; color: #4a4a45; margin-bottom: 0; }
.faq-drawer-body .faq-q {
  border: 1px solid rgba(0,0,0,0.12); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; background: #ffffff;
}
.faq-drawer-body .faq-q h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.faq-drawer-body .faq-q p { margin: 0; font-size: 13.5px; color: #4a4a45; }
/* 2026-08-18: while either drag (move or resize) is active, block text
   selection across the whole page -- otherwise fast mouse movement during
   a drag highlights sidebar/body text, same class toggled on <body> by
   faq-drawer.js. */
body.faq-drawer-no-select { user-select: none; }
@media (max-width: 900px) {
  .faq-drawer-panel { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; top: 0 !important; left: 0 !important; }
  .faq-drawer-resize { display: none; }
  .faq-drawer-header { cursor: default; }
  .faq-drawer-body { padding: 8px 20px 60px; }
  .faq-drawer-body .grid-2, .faq-drawer-body .grid-3 { grid-template-columns: 1fr; }
}
