/* Quiet side-reference layer, using Admin's existing theme and typography. */
.help-header-button, .help-context-button {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 36px; min-height: 36px; padding: 0; border: 1px solid var(--color-gray-300);
  border-radius: 50%; background: var(--color-white); color: var(--color-primary);
  font: 600 17px var(--font-family); cursor: pointer; vertical-align: middle;
}
.help-context-button { margin-left: 8px; width: 30px; min-height: 30px; font-size: 15px; }
.help-header-button:hover, .help-context-button:hover { background: var(--color-gray-100); }
.help-panel {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); max-width: 100vw;
  height: 100vh; height: 100dvh; max-height: none; padding: 20px; border: 0;
  border-left: 1px solid var(--color-gray-300); box-sizing: border-box;
  background: var(--color-white); color: var(--color-gray-900); font-family: var(--font-family);
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.help-panel[open] { display: flex; flex-direction: column; gap: 12px; }
.help-panel::backdrop { background: rgb(0 0 0 / 38%); }
.help-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.help-panel-header h2 { margin: 0; font-size: 22px; }
.help-search-label { font-weight: 600; font-size: 13px; margin-bottom: -6px; }
.help-panel .form-input { width: 100%; min-height: 44px; flex-shrink: 0; }
.help-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--color-gray-300); }
.help-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 6px; color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
.help-tab[aria-selected="true"] { border-bottom-color: var(--color-primary); font-weight: 600; }
.help-tab[hidden] { display: none; }
.help-status { margin: 0; font-size: 13px; line-height: 1.5; color: var(--color-gray-700); }
.help-panel-content { overflow: auto; min-height: 0; flex: 1; padding: 4px; scroll-padding-block: 8px; overflow-wrap: anywhere; }
.help-panel-content h3 { margin: 18px 0 10px; font-size: 17px; }
.help-panel-content h4 { font-size: 14px; margin: 0 0 8px; }
.help-panel-content p { line-height: 1.6; margin: 8px 0; font-size: 14px; }
.help-result { display: block; width: 100%; padding: 12px; margin: 8px 0; text-align: left; border: 1px solid var(--color-gray-300); border-radius: var(--radius-md); background: var(--color-gray-100); color: inherit; font: 600 14px var(--font-family); line-height: 1.5; cursor: pointer; }
.help-result-line { display: block; font-weight: 400; font-size: 13px; margin-top: 6px; }
.help-article-group + .help-article-group { margin-top: 24px; }
.help-rule, .help-step { padding: 12px; margin: 12px 0; border-left: 3px solid var(--color-gray-300); background: var(--color-gray-100); border-radius: var(--radius-sm); }
.help-rule h3 { margin-top: 0; }
.help-step-target { border-left-color: var(--color-primary); }
.help-panel small { display: block; margin-top: 14px; color: var(--color-gray-700); }
.help-panel img { display: block; width: 100%; height: auto; margin-top: 12px; border-radius: var(--radius-sm); }
/* UI-021: a step screenshot is a button that opens the picture larger over the panel. */
.help-panel .help-shot { display: block; width: 100%; margin: 12px 0 0; padding: 0; border: 1px solid var(--color-gray-300); border-radius: var(--radius-sm); background: var(--color-white); color: inherit; font: inherit; text-align: left; cursor: zoom-in; overflow: hidden; }
.help-panel .help-shot img { margin: 0; border-radius: 0; }
.help-panel .help-shot-hint { display: block; padding: 6px 10px; border-top: 1px solid var(--color-gray-300); font-size: 12px; color: var(--color-gray-700); }
.help-panel .help-shot:hover .help-shot-hint { color: var(--color-primary); }
.help-panel .help-shot-zoom { width: min(820px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 16px; border: 0; border-radius: var(--radius-md); box-sizing: border-box; background: var(--color-white); color: var(--color-gray-900); box-shadow: var(--shadow-xl); overflow: auto; overscroll-behavior: contain; }
.help-panel .help-shot-zoom[open] { display: flex; flex-direction: column; gap: 12px; }
.help-panel .help-shot-zoom::backdrop { background: rgb(0 0 0 / 60%); }
.help-panel .help-shot-zoom-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.help-panel .help-shot-zoom-header p { margin: 0; font-size: 14px; line-height: 1.5; }
.help-panel .help-shot-zoom-frame { min-width: 0; }
.help-panel .help-shot-zoom img { width: auto; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--color-gray-300); }
.help-panel mark { background: #ffe58a; color: #212529; border-radius: 2px; }
.help-panel :focus-visible, .help-header-button:focus-visible, .help-context-button:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .help-panel { width: 100vw; border: 0; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .help-header-button { width: 44px; min-height: 44px; }
  .help-context-button { min-width: 44px; min-height: 44px; }
  .help-panel .help-shot-zoom { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
}
