/* =====================================================================
   HRKLIX — In-app help (hrklix-help.js)
   1. Page help side panel   2. Field tips   3. Helper line under a field
   ===================================================================== */

/* ---------- 1. Page help panel ---------- */
.hx-help-trigger[aria-expanded="true"] {
  border-color: var(--hx-navy);
  background: var(--hx-navy-bg);
  color: var(--hx-navy);
}

/* the copy inside a fullscreen grid's title, where the topbar is covered */
.hx-help-grid { display: none; }
.s-DataGrid.fullscreen .grid-title .hx-help-grid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-inline-start: 10px;
  padding: 0;
  vertical-align: middle;
  border-radius: 9px;
  border: 1px solid var(--hx-line);
  background: var(--hx-surface);
  color: var(--hx-ink-2);
  cursor: pointer;
}
.s-DataGrid.fullscreen .grid-title .hx-help-grid:hover { border-color: var(--hx-sky); color: var(--hx-sky-deep); }
.hx-help-grid .icon {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.hx-help-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(420px, 100vw);
  z-index: 10050; /* above jQuery UI dialogs and drawers, so it also opens from a field tip */
  background: var(--hx-surface);
  border-left: 1px solid var(--hx-line);
  box-shadow: -16px 0 40px -24px rgba(13, 32, 80, .35);
  display: flex;
  flex-direction: column;
  font-family: var(--hx-font-ui);
  color: var(--hx-ink);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .22s ease, visibility 0s linear .22s;
  outline: none;
}
.hx-help-panel.is-open {
  transform: none;
  visibility: visible;
  transition: transform .22s ease;
}
/* the panel always docks on the end side of the app, whatever language it shows */
body.rtl .hx-help-panel {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid var(--hx-line);
  box-shadow: 16px 0 40px -24px rgba(13, 32, 80, .35);
  transform: translateX(-105%);
}
body.rtl .hx-help-panel.is-open { transform: none; }
.hx-help-panel[lang="ar"] { font-family: 'Cairo', var(--hx-font-ui); }

.hx-help-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--hx-line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hx-help-headrow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.hx-help-titles { display: flex; flex-direction: column; gap: 2px; }
.hx-help-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--hx-sky-deep);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.hx-help-panel[lang="ar"] .hx-help-eyebrow { text-transform: none; letter-spacing: 0; }
.hx-help-title {
  margin: 0;
  font-family: var(--hx-font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--hx-navy);
  line-height: 1.3;
}
.hx-help-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.hx-help-lang,
.hx-help-close {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--hx-navy-line);
  background: var(--hx-surface);
  color: var(--hx-navy);
  font: 700 12.5px 'Cairo', var(--hx-font-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hx-help-close { padding: 0; }
.hx-help-lang:hover,
.hx-help-close:hover { border-color: var(--hx-sky); color: var(--hx-sky-deep); }
.hx-help-close svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
.hx-help-intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--hx-ink-2);
}
.hx-help-panel[lang="ar"] .hx-help-intro { line-height: 1.75; }

.hx-help-body {
  flex: 1 1 auto;
  min-height: 0; /* a flex child will not shrink below its content without this, so it never scrolled */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.hx-help-sec { display: flex; flex-direction: column; gap: 10px; }
.hx-help-h3 {
  margin: 0;
  font: 700 12px var(--hx-font-ui);
  color: var(--hx-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.hx-help-panel[lang="ar"] .hx-help-h3 { font: 700 13px 'Cairo', sans-serif; text-transform: none; letter-spacing: 0; }

.hx-help-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hx-help-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--hx-ink-2); }
.hx-help-checks svg {
  flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px;
  fill: none; stroke: var(--hx-green-deep); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}

.hx-help-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hx-help-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.55; }
.hx-help-steps li span:not(.hx-help-num) { color: var(--hx-ink-2); }
.hx-help-num {
  flex: 0 0 24px; height: 24px; border-radius: 50%;
  background: var(--hx-navy-bg); color: var(--hx-navy);
  font: 700 12px var(--hx-font-ui);
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

.hx-help-terms { margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.55; }
.hx-help-terms dt { font-weight: 700; color: var(--hx-ink); }
.hx-help-terms dd { margin: 2px 0 0; color: var(--hx-ink-2); }

.hx-help-note { background: var(--hx-teal-bg); border-radius: 12px; padding: 14px 16px; }
.hx-help-note .hx-help-h3 { color: #0B7A84; }
.hx-help-note p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--hx-ink-2); }

.hx-help-warn { background: var(--hx-orange-bg); border-radius: 12px; padding: 14px 16px; }
.hx-help-warn .hx-help-h3 { color: var(--hx-orange-deep); }
.hx-help-warn ul { margin: 0; padding-inline-start: 18px; font-size: 13.5px; line-height: 1.6; color: var(--hx-ink-2); }
.hx-help-warn li + li { margin-top: 4px; }

.hx-help-related { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-help-related a {
  font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 7px 12px; border-radius: 999px;
  background: var(--hx-navy-bg); color: var(--hx-navy-3);
}
.hx-help-related a:hover { background: var(--hx-navy-line); color: var(--hx-navy-2); }

/* ---------- 2. Field tips ---------- */
.hx-tip-btn {
  width: 20px;
  height: 20px;
  margin-inline-start: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hx-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -4px;
  cursor: pointer;
}
.hx-tip-btn:hover,
.hx-tip-btn[aria-expanded="true"] { background: var(--hx-navy); color: #fff; }
.hx-tip-btn:focus-visible { outline: none; box-shadow: var(--hx-focus); }
.hx-tip-btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}

.hx-tip {
  position: fixed;
  z-index: 10060;
  width: min(340px, calc(100vw - 16px));
  box-sizing: border-box;
  background: var(--hx-navy-2);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--hx-shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font: 400 13.5px/1.55 var(--hx-font-ui);
}
.hx-tip[lang="ar"] { font-family: 'Cairo', var(--hx-font-ui); line-height: 1.7; }
.hx-tip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hx-tip-head strong { font: 700 14.5px var(--hx-font-display); }
.hx-tip[lang="ar"] .hx-tip-head strong { font-family: 'Cairo', sans-serif; }
.hx-tip-alt { font: 600 12.5px 'Cairo', var(--hx-font-ui); color: var(--hx-navy-line); }
.hx-tip p { margin: 0; color: #E8EEF9; }
.hx-tip ul { margin: 0; padding-inline-start: 18px; color: #E8EEF9; font-size: 13px; }
.hx-tip-ex { background: rgba(255, 255, 255, .09); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.hx-tip-more {
  align-self: flex-start;
  border: 0; background: transparent; padding: 0;
  color: var(--hx-sky); font: 600 13px inherit; font-family: inherit;
  cursor: pointer;
}
.hx-tip-more:hover { text-decoration: underline; }

/* ---------- 3. Helper line under a field ---------- */
.s-Form .field > .hx-help-line {
  flex-basis: 100%;
  width: 100%;
  clear: both;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--hx-muted);
}

/* the panel takes focus when it opens (so Tab starts inside it); the theme's
   generic focus ring would frame the whole panel */
.hx-help-panel:focus,
.hx-help-panel:focus-visible {
  outline: none !important;
  box-shadow: -16px 0 40px -24px rgba(13, 32, 80, .35) !important;
}
body.rtl .hx-help-panel:focus,
body.rtl .hx-help-panel:focus-visible {
  box-shadow: 16px 0 40px -24px rgba(13, 32, 80, .35) !important;
}

/* footer: the link to the whole job in the Help Center */
.hx-help-foot {
  flex: 0 0 auto;
  padding: 14px 22px;
  border-top: 1px solid var(--hx-line-soft);
}
.hx-help-manual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hx-navy-3);
  text-decoration: none;
}
.hx-help-manual:hover { color: var(--hx-sky-deep); text-decoration: underline; }

.hx-help-manual svg {
  width: 16px; height: 16px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
