/* Help & guides: the hub, guides, glossary, the in-page drawer and the 'Ask the portal' box. Builds on the design-system tokens in style.css. */

/* ---------------------------------------------------------------- hub */
.help-hero { padding: 20px 22px; display: grid; gap: 18px; }
.help-ask-lbl { display: block; font-weight: 800; font-size: 14px; margin: 0 0 6px; }
.help-ask-row { display: flex; gap: 8px; }
.help-ask-row input[type=text], .help-ask-row input[type=search] { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--ink-20); border-radius: var(--radius-pill); font: inherit; background: var(--paper); }
.help-ask-row input:focus { outline: 4px solid var(--green-100); border-color: var(--sparkle-green); }
.help-ask-note { margin: 6px 4px 0; }
.help-search.card { padding: 14px 16px; margin-bottom: 14px; }

.help-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 0; }
.help-quick-item, .help-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: var(--color-text); text-decoration: none; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.help-quick-item:hover, .help-card:hover { border-color: var(--sparkle-green); text-decoration: none; transform: translateY(-1px); }
.help-quick-item strong, .help-card strong { font-size: 14.5px; }
.help-quick-item span, .help-card span { font-size: 12.5px; color: var(--color-text-muted); line-height: 1.45; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-changes { padding: 6px 8px; }
.help-changes a { display: flex; gap: 14px; align-items: baseline; padding: 9px 10px; border-radius: 10px; color: var(--color-text); text-decoration: none; }
.help-changes a:hover { background: var(--color-surface); }
@media (max-width: 1000px) { .help-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .help-quick { grid-template-columns: 1fr; } .help-ask-row { flex-wrap: wrap; } }

/* ---------------------------------------------------------------- a guide */
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.help-side { position: sticky; top: 12px; display: grid; gap: 12px; }
.help-side-h { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin: 0 0 6px; }
.help-toc { padding: 14px 16px; display: flex; flex-direction: column; }
.help-toc a { padding: 4px 0; font-size: 13px; color: var(--color-text); }
.help-toc a.lvl3 { padding-left: 12px; font-size: 12.5px; color: var(--color-text-muted); }
.help-toc a.here { font-weight: 800; color: var(--green-700); }
@media (max-width: 1000px) { .help-layout { grid-template-columns: 1fr; } .help-side { position: static; } }

.help-doc { padding: 22px 28px; font-size: 14.5px; line-height: 1.65; max-width: none; }
.help-doc > *:first-child { margin-top: 0; }
.help-doc h2 { font-size: 19px; font-weight: 800; margin: 28px 0 8px; scroll-margin-top: 16px; }
.help-doc h3 { font-size: 15.5px; font-weight: 800; margin: 20px 0 6px; scroll-margin-top: 16px; }
.help-doc p, .help-doc li { max-width: 78ch; }
.help-doc ul, .help-doc ol { padding-left: 22px; }
.help-doc li { margin: 3px 0; }
.help-doc code { font-family: var(--font-data); font-size: 12.5px; background: var(--color-surface); padding: 1px 6px; border-radius: 6px; }
.help-doc pre { background: var(--color-surface); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.help-doc table { border-collapse: collapse; margin: 12px 0; font-size: 13.5px; width: 100%; min-width: 0; }
.help-doc-drawer table { display: table; width: 100%; min-width: 0; max-width: 100%; table-layout: auto; font-size: 12px; }   /* style.css gives every table min-width 720px */
.help-doc-drawer th, .help-doc-drawer td { white-space: normal; overflow-wrap: break-word; word-break: normal; padding: 6px 6px; min-width: 0; }
.help-doc-drawer th { font-size: 10.5px; letter-spacing: 0; }
.help-doc th, .help-doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--ink-10); }
.help-doc th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }
.help-doc kbd { font-family: var(--font-data); font-size: 12px; border: 1px solid var(--ink-20); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--paper); }
.help-doc img { max-width: 100%; border-radius: 10px; box-shadow: var(--shadow-sm); }
.help-doc .admonition { margin: 14px 0; padding: 12px 16px; border-radius: 12px; background: var(--blue-100); border-left: 4px solid var(--blue-600); }
.help-doc .admonition p { margin: 4px 0; }
.help-doc .admonition-title { font-weight: 800; }
.help-doc .admonition.tip { background: var(--green-100); border-color: var(--sparkle-green); }
.help-doc .admonition.warning { background: var(--beige-100); border-color: var(--warn); }
.help-doc .admonition.danger { background: var(--red-100); border-color: var(--red-600); }
.help-term { color: inherit; text-decoration: underline dotted var(--sparkle-green) 2px; text-underline-offset: 3px; cursor: help; }
.help-flash { animation: help-flash 2s ease-out; }
@keyframes help-flash { from { background: var(--green-100); } to { background: transparent; } }
.help-doc-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--ink-10); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }

/* ---------------------------------------------------------------- rating and gaps */
.help-rate { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.help-rate .linkish, .help-ans .linkish { border: 0; background: none; padding: 0; color: var(--blue-600); cursor: pointer; font: inherit; text-decoration: underline; }
.help-gap { flex-basis: 100%; display: grid; gap: 6px; }
.help-gap[hidden], .help-rate [hidden] { display: none; }
.help-gap textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--ink-20); border-radius: 10px; }

.help-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
@media (max-width: 1000px) { .help-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- the assistant's answer */
.help-answer:empty { display: none; }
.help-answer { margin-top: 12px; }
.help-ans { padding: 14px 16px; border-radius: 14px; background: var(--color-surface); border-left: 4px solid var(--sparkle-green); font-size: 14px; }
.help-ans.not-covered { border-color: var(--warn); }
.help-ans p { margin: 4px 0 8px; }
.help-ans-src { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.help-ans-src b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--green-100); color: var(--green-700); font-size: 11px; }
.help-cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0 1px; border-radius: 9px; background: var(--green-100); color: var(--green-700);
  font-size: 11px; font-weight: 800; text-decoration: none; vertical-align: 1px; }
.help-ans-foot { margin: 8px 0 0; }
.help-thinking::after { content: ""; display: inline-block; width: 1em; animation: help-dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes help-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------------------------------------------------------------- glossary, search, what's new */
.help-letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.help-letters a { min-width: 28px; text-align: center; padding: 3px 6px; border-radius: 8px; background: var(--paper); font-weight: 700; font-size: 13px; text-decoration: none; }
.help-gloss { padding: 8px 24px 18px; }
.help-letter { font-size: 13px; font-weight: 800; color: var(--color-text-muted); margin: 18px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--ink-10); }
.help-term-row { margin: 0; padding: 10px 0; scroll-margin-top: 16px; }
.help-term-row:target { background: var(--green-100); border-radius: 10px; padding: 10px 12px; }
.help-term-row dt { font-weight: 800; }
.help-term-row dd { margin: 3px 0 0; max-width: 80ch; line-height: 1.55; }
.help-term-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 5px; color: var(--color-text-muted); }
.help-results { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.help-results li { background: var(--paper); border-radius: var(--radius-md); padding: 12px 16px; box-shadow: var(--shadow-sm); }
.help-results a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: var(--color-text); }
.help-results p { margin: 4px 0 0; }
.help-kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--ink-10); white-space: nowrap; }
.help-kind.guide { background: var(--green-100); color: var(--green-700); }
.help-kind.term { background: var(--blue-100); color: var(--blue-600); }
.help-timeline { display: grid; gap: 14px; }
.help-change header { display: flex; gap: 12px; align-items: baseline; padding: 18px 28px 0; }
.help-change h2 { font-size: 17px; margin: 0; }
.help-change .help-doc { padding-top: 8px; }

/* ---------------------------------------------------------------- portal map and roles (inside guides) */
.help-map { display: grid; gap: 6px; margin: 12px 0; }
.help-map-group h3 { margin: 18px 0 8px; }
.help-map-mod { padding: 10px 14px; border-radius: 12px; background: var(--color-surface); margin-bottom: 8px; }
.help-map-mod.locked { background: transparent; border: 1px dashed var(--ink-20); }
.help-map-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.help-map-mod p { margin: 4px 0 0; max-width: none; }
.help-roles .tbl td { vertical-align: top; }

/* ---------------------------------------------------------------- the in-page drawer */
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--paper); box-shadow: -12px 0 40px rgba(20, 35, 59, .18); z-index: 45;   /* over the sidebar (40), under the top-bar menus (50) and search (100) */
  display: flex; flex-direction: column; }
.help-drawer[hidden] { display: none; }
.help-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--ink-10); }
.help-drawer-tools { display: flex; gap: 10px; align-items: center; }
.help-drawer-body { overflow-y: auto; padding: 16px 18px 28px; flex: 1; }
.help-drawer-title { font-size: 18px; margin: 4px 0 6px; }
.help-doc-drawer { padding: 0; font-size: 13.5px; margin: 10px 0 16px; }
.help-doc-drawer h2 { font-size: 16px; }
.help-doc-drawer h3 { font-size: 14px; }
.help-drawer .help-rate { padding: 12px 0; border-top: 1px solid var(--ink-10); }
.help-drawer-cav { padding: 10px 12px; border-radius: 10px; background: var(--beige-100); }
.help-ask.compact { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ink-10); }
@media (min-width: 1300px) { body.help-open .main { margin-right: 440px; } }
@media print { .help-drawer, .help-side, .help-rate, .help-ask { display: none !important; } .help-layout { display: block; } }
