/* Guidance (RXCON-57): inline help "?" buttons, the Related (associated items) panel, filter chips and the customer page.
   Loaded after tenant-config.css. Mobile first: nothing here makes the page scroll sideways at 375px. */

/* ---- Inline help ---- */
.wb-term { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.wb-term-help { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; }
.wb-term-button { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--field); background: var(--white); color: var(--navy); font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; }
.wb-term-button:hover { background: var(--tint); }
.wb-term-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wb-term-button[aria-expanded="true"] { background: var(--tint); border-color: var(--navy); }
.wb-term-pop { position: fixed; z-index: 60; box-sizing: border-box; width: min(320px, calc(100vw - 16px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); box-shadow: 0 8px 24px rgba(10, 30, 60, 0.18); font-size: 14px; font-weight: 400; line-height: 1.45; text-align: left; text-transform: none; letter-spacing: 0; white-space: normal; }
.wb-term-pop[hidden] { display: none; }
.wb-term-pop .wb-term-title { display: block; margin-bottom: 4px; color: var(--navy); }
.wb-term-pop .wb-term-text { margin: 0 0 8px; }
.wb-term-pop a { color: var(--blue); font-weight: 600; }
.wb-col-number .wb-term-help, th .wb-term-help { margin-left: 2px; }
.wb-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.wb-terms-label { font-weight: 600; }
.help-glossary { display: grid; gap: 12px; margin: 0; }
.help-glossary dt { margin: 0; font-weight: 700; color: var(--navy); scroll-margin-top: 16px; }
.help-glossary dd { margin: 2px 0 0; }
.help-glossary dt:target { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- Filter chips ---- */
.wb-scope-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.wb-scope-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 12px; border: 1px solid var(--chip-on-line); border-radius: 999px; background: var(--tint); color: var(--navy); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.wb-scope-chip button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--navy); font-size: 18px; line-height: 1; cursor: pointer; }
.wb-scope-chip button:hover { background: var(--white); }
.wb-scope-chip button:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }

/* ---- Related (associated items): a right-side column from 1200px, a collapsible section above the content below ---- */
.wb-with-related { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wb-with-related > .wb-main { order: 2; min-width: 0; }
.wb-with-related > .wb-related-host { order: 1; min-width: 0; }
.wb-related { box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.wb-related-title { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.wb-related-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--navy); font-weight: 700; cursor: pointer; }
.wb-related-toggle::after { content: "+"; font-size: 20px; line-height: 1; }
.wb-related-toggle[aria-expanded="true"]::after { content: "-"; }
.wb-related[data-open="false"] .wb-related-list { display: none; }
.wb-related-scope { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.wb-related-list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.wb-related-item { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.wb-related-item:hover { background: var(--tint); border-color: var(--chip-on-line); }
.wb-related-item:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wb-related-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--blue); font-weight: 700; }
.wb-related-count { flex: none; min-width: 24px; padding: 0 8px; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: 13px; text-align: center; }
.wb-related-note { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.wb-related-status { display: block; margin-top: 4px; }
@media (min-width: 1200px) {
  .wb-with-related { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 20px; }
  .wb-with-related > .wb-main { order: 1; }
  .wb-with-related > .wb-related-host { order: 2; position: sticky; top: 16px; }
  .wb-related-toggle { display: none; }
  .wb-related[data-open="false"] .wb-related-list { display: grid; }
}
@media (max-width: 1199px) {
  .wb-related-title { display: none; }
  .wb-related[data-open="false"] .wb-related-scope { display: none; }
}

/* ---- Customer page ---- */
.cu-status { margin: 4px 0 0; font-weight: 600; }
.cu-section, .cu-tenants, .cu-users, .cu-releases { margin: 0 0 20px; min-width: 0; }
.cu-section > h2, .cu-tenants > h2, .cu-users > h2, .cu-releases > h2 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.cu-check-detail { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }
.cu-checklist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cu-check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; background: var(--white); }
.cu-check[data-done="true"] { border-left-color: var(--good); }
.cu-check[data-done="false"] { border-left-color: var(--warn-dot); }
.cu-check-word { font-weight: 700; white-space: nowrap; }
.cu-check-text { min-width: 0; overflow-wrap: anywhere; }
.cu-check-action { grid-column: 1 / -1; justify-self: start; }
.cu-check-action a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 8px; background: var(--blue); color: var(--white); font-weight: 700; text-decoration: none; }
.cu-check-action a:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.cu-note { margin: 0 0 8px; color: var(--muted); }
@media (min-width: 640px) {
  .cu-check { grid-template-columns: 7rem minmax(0, 1fr) auto; align-items: center; }
  .cu-check-action { grid-column: auto; }
}

/* ---- Terms disclosure and unknown scope notice (WP2) ---- */
.wb-terms-disclosure { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.wb-terms-disclosure summary { cursor: pointer; font-weight: 600; min-height: 24px; }
.wb-terms-disclosure summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wb-terms-list { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; }
.wb-scope-unknown { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-left: 4px solid var(--warn, #b25e00); border-radius: 8px; background: var(--white); }
