/* Hegel Self-Help — the "? Help" button and its drawer.
 *
 * SELF-HELP-1. This file is additive and identical in every application. It
 * styles nothing that already exists: every selector below is prefixed
 * `hh-`, a namespace no Hegel application uses, so this stylesheet cannot
 * restyle a working page even by accident.
 *
 * CSP: production is `style-src 'self'` with no 'unsafe-inline' in Shared
 * Services, Operations, HR and the Command Centre, so the engine never writes
 * an inline style. Everything that moves is a class toggle defined here.
 *
 * Custom properties are read with a literal fallback (`var(--h-blue,#2563EB)`)
 * because HR does not load hegel-shell.css. Help must look right there too.
 */

.hh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 12px;
  border: 1px solid var(--h-input-border, #D1D5DB);
  border-radius: var(--h-radius, 8px);
  background: var(--h-surface, #fff); color: var(--h-text, #111827);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.hh-btn:hover { background: #F2F4F7; text-decoration: none; }
.hh-btn:focus-visible { outline: 2px solid var(--h-blue, #2563EB); outline-offset: 2px; }
.hh-btn-mark { font-weight: 700; color: var(--h-blue, #2563EB); }

/* ---------------------------------------------------------------- drawer -- */
.hh-scrim {
  position: fixed; inset: 0; z-index: 2147483001;
  background: rgba(15, 39, 71, .38); border: 0; padding: 0; margin: 0;
  cursor: pointer;
}
.hh-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2147483002;
  width: 420px; max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--h-surface, #fff); color: var(--h-text, #111827);
  font-family: var(--h-font, "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif);
  border-left: 1px solid var(--h-border, #E5E7EB);
  box-shadow: -8px 0 28px rgba(15, 39, 71, .16);
}
.hh-hidden { display: none !important; }

.hh-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--h-border, #E5E7EB);
}
.hh-head-text { min-width: 0; flex: 1 1 auto; }
.hh-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--h-muted, #6B7280);
}
.hh-title {
  margin: 2px 0 0; font-size: 16px; font-weight: 700; line-height: 1.25;
  overflow-wrap: anywhere;
}
.hh-close {
  flex: 0 0 auto; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--h-input-border, #D1D5DB); border-radius: var(--h-radius, 8px);
  background: var(--h-surface, #fff); color: var(--h-text, #111827);
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
.hh-close:hover { background: #F2F4F7; }
.hh-close:focus-visible { outline: 2px solid var(--h-blue, #2563EB); outline-offset: 2px; }

.hh-body {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  padding: 16px; -webkit-overflow-scrolling: touch;
}
.hh-foot {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--h-border, #E5E7EB);
  background: #F9FAFB;
}

/* ---------------------------------------------------------------- blocks -- */
.hh-sec { margin: 0 0 18px; }
.hh-sec:last-child { margin-bottom: 0; }
.hh-h {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--h-muted, #6B7280);
}
.hh-p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.hh-p:last-child { margin-bottom: 0; }
.hh-ol, .hh-ul { margin: 0; padding-left: 20px; }
.hh-ol li, .hh-ul li { font-size: 14px; line-height: 1.55; margin-bottom: 6px; overflow-wrap: anywhere; }
.hh-ol li:last-child, .hh-ul li:last-child { margin-bottom: 0; }

.hh-note {
  border: 1px solid var(--h-border, #E5E7EB); border-left: 3px solid var(--h-blue, #2563EB);
  border-radius: var(--h-radius, 8px); background: #F5F8FF; padding: 10px 12px;
}
.hh-note-warn { border-left-color: var(--h-warning, #D97706); background: #FFF9F0; }
.hh-kbd {
  font-weight: 600; background: #EEF2F7; border: 1px solid var(--h-border, #E5E7EB);
  border-radius: 4px; padding: 1px 5px; font-size: 13px; white-space: nowrap;
}
.hh-step-n {
  display: inline-block; min-width: 22px; height: 22px; margin-right: 8px;
  border-radius: 11px; background: var(--h-blue, #2563EB); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; line-height: 22px;
}
.hh-guide-step { display: flex; align-items: flex-start; margin-bottom: 12px; }
.hh-guide-step:last-child { margin-bottom: 0; }
.hh-guide-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.55; }
.hh-guide-text b { font-weight: 700; }

.hh-link { color: var(--h-blue, #2563EB); font-weight: 600; }

/* ------------------------------------------------------------ Help Centre -- */
/* Used by the Shared Services Help Centre page, which renders its cards
   server-side; hegel-help-centre.js only shows and hides them. */
.hh-search-wrap { margin: 0 0 18px; }
.hh-search {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--h-input-border, #D1D5DB); border-radius: var(--h-radius, 8px);
  background: var(--h-surface, #fff); font: inherit; font-size: 15px;
  color: var(--h-text, #111827);
}
.hh-search:focus { outline: 2px solid #bfd3ff; border-color: var(--h-blue, #2563EB); }
.hh-search-hint { margin: 6px 0 0; font-size: 13px; color: var(--h-muted, #6B7280); }
.hh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.hh-chip {
  height: 30px; padding: 0 11px; border: 1px solid var(--h-input-border, #D1D5DB);
  border-radius: 15px; background: var(--h-surface, #fff); color: var(--h-text, #111827);
  font: inherit; font-size: 13px; cursor: pointer;
}
.hh-chip:hover { background: #F2F4F7; }
.hh-app-group { margin: 0 0 22px; }
.hh-app-name {
  margin: 0 0 10px; font-size: 15px; font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--h-border, #E5E7EB);
}
.hh-topic {
  border: 1px solid var(--h-border, #E5E7EB); border-radius: var(--h-radius, 8px);
  background: var(--h-surface, #fff); margin-bottom: 8px;
}
.hh-topic > summary {
  padding: 11px 14px; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none;
}
.hh-topic > summary::-webkit-details-marker { display: none; }
.hh-topic > summary::before { content: "\25B8"; margin-right: 8px; color: var(--h-muted, #6B7280); }
.hh-topic[open] > summary::before { content: "\25BE"; }
.hh-topic > summary:hover { background: #F9FAFB; }
.hh-topic-body { padding: 2px 14px 14px; border-top: 1px solid var(--h-border, #E5E7EB); }
.hh-empty {
  padding: 22px; text-align: center; color: var(--h-muted, #6B7280); font-size: 14px;
  border: 1px dashed var(--h-border, #E5E7EB); border-radius: var(--h-radius, 8px);
}

/* ---------------------------------------------------------------- mobile -- */
@media (max-width: 640px) {
  .hh-panel { width: 100vw; border-left: 0; }
  .hh-btn { height: 36px; padding: 0 10px; }          /* comfortable touch target */
  .hh-close { width: 40px; height: 40px; }
  .hh-body { padding: 14px; }
}

/* Respect a reduced-motion preference: there is no animation to begin with,
   which is deliberate — a help panel must appear instantly. */
