/* Help system: guide pages + context drawer */
body { overflow-x: hidden; }

/* --- PDCA phase badges --- */
.pd { display: inline-block; width: 13px; height: 13px; border-radius: 50%; font-size: 9px; font-weight: 800; line-height: 13px; text-align: center; margin-right: 5px; vertical-align: 1px; }
.pd-PLAN { background: #6C8FC7; color: #12253D; }
.pd-DO { background: #5FB08F; color: #12253D; }
.pd-CHECK { background: #E0B84E; color: #12253D; }
.pd-ACT { background: #E0604F; color: #FFFFFF; }
.pd-tag { display: inline-flex; align-items: center; gap: 5px; background: #EAF0F6; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px 2px 6px; font-size: 11px; font-weight: 700; color: var(--navy-2); }
.help-card .pd { margin-right: 4px; }

/* --- diagram zoom affordances --- */
.help-figure, .help-drawer-fig { position: relative; }
.help-figure svg, .help-drawer-fig svg { cursor: zoom-in; }
.help-figure::after {
  content: "⤢ click to zoom"; position: absolute; top: 10px; right: 12px;
  background: rgba(18,37,61,.78); color: #fff; font-size: 10.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px; pointer-events: none; opacity: .85;
}
.help-drawer-fig::after {
  content: "⤢ zoom"; position: absolute; top: 8px; right: 8px;
  background: rgba(18,37,61,.78); color: #fff; font-size: 9.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 9px; pointer-events: none; opacity: .85;
}

/* --- diagram viewer overlay --- */
.dz-overlay { position: fixed; inset: 0; background: rgba(18,37,61,.58); z-index: 120; display: none; flex-direction: column; }
.dz-overlay.open { display: flex; }
.dz-toolbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.dz-title { font-weight: 700; font-size: 14px; }
.dz-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dz-pct { font-size: 12.5px; color: #C9D6E4; min-width: 46px; text-align: center; }
.dz-toolbar .btn.ghost { color: #C9D6E4; border-color: #3A567A; }
.dz-stage { flex: 1; position: relative; overflow: hidden; background: #EEF2F7; touch-action: none; cursor: grab; }
.dz-stage.grabbing { cursor: grabbing; }
.dz-inner { position: absolute; }
.dz-inner svg { display: block; box-shadow: 0 8px 34px rgba(0,0,0,.30); border-radius: 10px; }
.dz-hint { background: var(--navy-2); color: #C9D6E4; text-align: center; font-size: 11.5px; padding: 6px; }

/* --- guide pages --- */
.help-crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.help-crumbs a { color: var(--navy-2); }
.help-figure { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.help-figure svg { display: block; }
.help-figure-note { color: var(--muted); font-size: 11.5px; margin-top: 8px; font-style: italic; }
.help-steps { margin: 4px 0 0; padding-left: 20px; }
.help-steps li { margin: 7px 0; line-height: 1.5; font-size: 13.5px; }
.help-steps.compact li { margin: 4px 0; font-size: 12.5px; }
.help-faq { border-top: 1px dashed var(--line); padding: 10px 0; }
.help-faq:first-of-type { border-top: none; }
.help-faq-q { font-weight: 700; color: var(--navy-2); font-size: 13.5px; }
.help-faq-a { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--text); }
.help-role-you td { background: #EAF4F0 !important; }
.help-related { display: block; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; line-height: 1.45; }
.help-related:last-child { border-bottom: none; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.help-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: block; transition: border-color .12s; }
.help-card:hover { border-color: var(--teal); text-decoration: none; }
.help-card-title { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.help-card-sum { color: var(--muted); font-size: 12.5px; margin: 5px 0 10px; line-height: 1.45; }
.help-card-more { color: var(--teal); font-size: 12px; font-weight: 700; }

/* --- context drawer --- */
.help-drawer {
  position: fixed; top: 0; right: -440px; width: 420px; max-width: 92vw; height: 100vh;
  background: #fff; box-shadow: -6px 0 28px rgba(18,37,61,.22); z-index: 90;
  transition: right .22s ease; display: flex; flex-direction: column;
}
.help-drawer.open { right: 0; }
.help-drawer-backdrop { position: fixed; inset: 0; background: rgba(18,37,61,.34); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 89; }
.help-drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.help-drawer-head { background: var(--navy); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.help-drawer-kicker { color: #9FB6D0; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; }
.help-drawer-title { font-size: 16px; font-weight: 700; }
.help-drawer-body { padding: 16px 18px 26px; overflow-y: auto; flex: 1; }
.help-drawer-sum { font-size: 13px; line-height: 1.55; color: var(--text); }
.help-drawer-fig { margin: 10px 0 4px; }
.help-drawer-fig svg { display: block; }
.help-drawer-fig-hint { color: var(--muted); font-size: 10.5px; margin-top: 4px; font-style: italic; }
.help-drawer-block { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
.help-drawer-h { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.help-drawer-role { font-size: 12.5px; padding: 3px 0; line-height: 1.45; }
.help-drawer-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.help-drawer-note { margin-top: 14px; color: var(--muted); font-size: 11px; font-style: italic; }
.help-btn { position: relative; }
.help-btn .hb-dot { position: absolute; top: 3px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

@media print {
  .topbar, .help-drawer, .help-drawer-backdrop, .footer-note .btn { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
}
