/* HELP-1663 Help Center: public pages (/help, /help/<slug>, with css/website.css) and the in-app help bits
   (the "?" buttons and the help viewer, with css/index.css). ChiroApp theme: --w-brand #355E3B. */

/* ---------- public pages ---------- */
.hc-page { background: var(--w-bg-alt, #f8faf8); }
.hc-main { padding: 7.5rem 1rem 3rem; }
.hc-wrap { max-width: 860px; margin: 0 auto; }
.hc-wrap h1 { font-size: 2rem; line-height: 1.2; color: var(--w-text, #1a1a2e); margin: 0.25rem 0 0.5rem; }
.hc-wrap h2 { font-size: 1.25rem; color: var(--w-text, #1a1a2e); margin: 2rem 0 0.75rem; }
.hc-crumbs { font-size: 0.85rem; color: var(--w-text-muted, #5a6270); margin: 0; }
.hc-crumbs a, .hc-back a, .hc-related a, .hc-intro a, .hc-after a, .hc-step a { color: var(--w-brand, #355E3B); font-weight: 600; }
.hc-summary { font-size: 1.05rem; color: var(--w-text-muted, #5a6270); line-height: 1.6; margin: 0 0 1rem; }
.hc-intro, .hc-after { font-size: 0.98rem; line-height: 1.65; color: #2d3748; background: #fff; border: 1px solid var(--w-border, #e2e8f0);
    border-radius: 12px; padding: 0.9rem 1.1rem; margin: 0 0 1rem; }
.hc-after { border-left: 4px solid var(--w-brand, #355E3B); }
.hc-steps { counter-reset: hc; list-style: none; padding: 0; margin: 0; }
.hc-step { counter-increment: hc; position: relative; background: #fff; border: 1px solid var(--w-border, #e2e8f0); border-radius: 14px;
    padding: 1rem 1.1rem 1.1rem 3.6rem; margin: 0 0 1rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03); }
.hc-step::before { content: counter(hc); position: absolute; left: 1rem; top: 0.95rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--w-brand, #355E3B); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.hc-step > p { margin: 0.15rem 0 0.75rem; font-size: 1rem; line-height: 1.65; color: #1f2937; }
.hc-label { font-weight: 700; color: #1a202c; background: var(--w-brand-pale, #e8f0e9); border-radius: 5px; padding: 0 0.3em; white-space: nowrap; }
.hc-shot { display: block; max-width: 100%; height: auto; border: 1px solid var(--w-border, #e2e8f0); border-radius: 10px; }
.hc-shot-phone { max-width: min(260px, 100%); margin-top: 0.5rem; }   /* LEGAL-1672: reflows at 320px (WCAG 1.4.10) */
.hc-phone { background: #fffbeb; border: 1px solid #f5d38a; border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0 0 0.75rem; }
.hc-step > .hc-shot-phone, .hc-step > .hc-phone-text { display: none; }   /* HELPDEVICE-1127: shown in Phone mode only */
.hc-step > .hc-shot-phone { max-width: min(390px, 100%); margin-top: 0; }
.hc-phone p { margin: 0; font-size: 0.92rem; line-height: 1.55; color: #4a3b10; }
.hc-phone-tag { font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; background: #f59e0b; color: #1f2937; border-radius: 4px; padding: 1px 6px; margin-right: 4px; }
/* HELPDEVICE-1127: Phone mode shows the phone note + phone shot (and hides the computer shot of a step that has a phone shot); Computer mode the opposite.
   js/help-page.js sets <html data-device>; with no script the screen decides (the app's own menu-button layout breakpoint, 1024px: a tablet upright gets the menu-button pictures). */
:root[data-device="phone"] .hc-step > .hc-shot-phone, :root[data-device="phone"] .hc-step > .hc-phone-text { display: block; }
:root[data-device="phone"] .hc-has-phone-shot > .hc-shot-pc { display: none; }
@media (max-width: 1024px), (max-height: 500px) and (pointer: coarse) {
    :root:not([data-device]) .hc-step > .hc-shot-phone, :root:not([data-device]) .hc-step > .hc-phone-text { display: block; }
    :root:not([data-device]) .hc-has-phone-shot > .hc-shot-pc { display: none; }
}
.hc-device { display: flex; align-items: center; gap: 0.4rem; margin: 0.25rem 0 1rem; flex-wrap: wrap; }
.hc-device[hidden] { display: none; }
.hc-device-label { font-size: 0.85rem; font-weight: 600; color: var(--w-text-muted, #5a6270); margin-right: 0.1rem; }
.hc-device-btn { border: 1px solid var(--w-brand, #355E3B); background: #fff; color: var(--w-brand, #355E3B); border-radius: 999px; padding: 0.4rem 0.9rem; min-height: 36px;
    font-weight: 600; cursor: pointer; font-size: 0.88rem; }
.hc-device-btn[aria-pressed="true"] { background: var(--w-brand, #355E3B); color: #fff; }
.hc-variant-tabs { display: flex; gap: 0.5rem; margin: 0.5rem 0 1rem; flex-wrap: wrap; }
.hc-variant-tab { border: 1px solid var(--w-brand, #355E3B); background: #fff; color: var(--w-brand, #355E3B); border-radius: 999px; padding: 0.45rem 1rem;
    font-weight: 600; cursor: pointer; font-size: 0.92rem; }
.hc-variant-tab[aria-pressed="true"] { background: var(--w-brand, #355E3B); color: #fff; }
.hc-variant > h2 { margin-top: 1rem; }
.hc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.hc-card { display: flex; flex-direction: column; gap: 0.35rem; background: #fff; border: 1px solid var(--w-border, #e2e8f0); border-radius: 14px;
    padding: 1rem 1.1rem; text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.hc-card:hover, .hc-card:focus-visible { border-color: var(--w-brand, #355E3B); box-shadow: 0 6px 20px rgba(53, 94, 59, 0.12); }
.hc-card-title { font-weight: 700; color: var(--w-brand-dark, #2a4d30); font-size: 1.02rem; }
.hc-card-summary { font-size: 0.9rem; color: var(--w-text-muted, #5a6270); line-height: 1.5; }
.hc-related ul { padding-left: 1.2rem; }
.hc-related li { margin: 0.3rem 0; }
.hc-back { margin-top: 2rem; }
.hc-site-footer a { color: rgba(255, 255, 255, 0.7); }
/* embedded in the app's help viewer (?embed=1): no site chrome */
.hc-embed .hc-site-nav, .hc-embed .hc-site-footer, .hc-embed .hc-back { display: none; }
.hc-embed .hc-main { padding: 1rem 0.75rem 2rem; }
.hc-embed .hc-wrap h1 { font-size: 1.5rem; }
@media (max-width: 640px) {
    .hc-main { padding-top: 6rem; }
    .hc-step { padding: 0.9rem 0.9rem 1rem 3.1rem; }
    .hc-step::before { left: 0.75rem; width: 1.7rem; height: 1.7rem; font-size: 0.85rem; }
    .hc-wrap h1 { font-size: 1.6rem; }
}

/* ---------- in the app ---------- */
.hc-has-q { display: inline-block; vertical-align: middle; }
.hc-q { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; margin-left: 0.5rem; vertical-align: middle;
    border-radius: 50%; border: 1.5px solid var(--primary-500, #355E3B); background: transparent; color: var(--primary-500, #355E3B);
    font-weight: 700; font-size: 0.9rem; line-height: 1; cursor: pointer; padding: 0; flex-shrink: 0; }
.hc-q:hover, .hc-q:focus-visible { background: var(--primary-500, #355E3B); color: #fff; }
.hc-viewer { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.hc-viewer-box { background: var(--bg-primary, #fff); width: min(920px, 100%); height: min(88vh, 100%); border-radius: 16px; display: flex; flex-direction: column;
    overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
.hc-viewer-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border, #e2e8f0); flex-wrap: wrap; }
.hc-viewer-bar strong { flex: 1; font-size: 0.95rem; min-width: 8rem; }
.hc-viewer-bar a, .hc-viewer-bar button { font-size: 0.85rem; }
.hc-viewer-close { border: none; background: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted, #64748b); padding: 0 0.3rem; }
.hc-viewer iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: #f8faf8; }
@media (max-width: 640px) { .hc-viewer { padding: 0; } .hc-viewer-box { height: 100%; border-radius: 0; } }
/* HELPLIST-1683 (owner 2026-11-26): Help Articles = a search box + collapsible groups of title-only rows. */
.hc-list { display: block; }
.hc-search { margin: 0 0 0.6rem; }
.hc-search-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary, #475569); margin-bottom: 0.25rem; }
.hc-search-input { width: 100%; box-sizing: border-box; font-size: 16px; /* 16px: iOS does not zoom the page on focus */ padding: 0.55rem 0.75rem; border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px; background: var(--bg-primary, #fff); color: inherit; min-height: 44px; }
.hc-search-input:focus-visible { outline: 2px solid var(--primary-500, #355E3B); outline-offset: 1px; }
.hc-empty { margin: 0.5rem 0; }
.hc-group { border: 1px solid var(--border, #e2e8f0); border-radius: 12px; margin: 0 0 0.5rem; background: var(--bg-secondary, #f8fafc); overflow: hidden; }
.hc-group[hidden], .hc-group-body[hidden], .hc-row[hidden], .hc-empty[hidden] { display: none; }
.hc-group-head { width: 100%; display: flex; align-items: center; gap: 0.5rem; text-align: left; border: 0; background: none; color: inherit; cursor: pointer;
    padding: 0.7rem 0.85rem; min-height: 44px; font-size: 0.95rem; font-weight: 700; }
.hc-group-head:focus-visible, .hc-row:focus-visible { outline: 2px solid var(--primary-500, #355E3B); outline-offset: -2px; }
.hc-group-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hc-group-count { font-size: 0.78rem; font-weight: 600; color: var(--text-muted, #64748b); }
.hc-group-chev { font-style: normal; color: var(--text-muted, #64748b); transition: transform 0.15s; }
.hc-group-head[aria-expanded="true"] .hc-group-chev { transform: rotate(180deg); }
.hc-group-head[aria-disabled="true"] { cursor: default; }
.hc-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--border, #e2e8f0); background: var(--bg-primary, #fff); }
.hc-row { text-align: left; border: 0; border-bottom: 1px solid var(--border, #e2e8f0); background: none; color: inherit; cursor: pointer; padding: 0.65rem 0.85rem; min-height: 44px;
    display: flex; align-items: center; }
.hc-row strong { font-size: 0.92rem; font-weight: 500; overflow-wrap: anywhere; }
.hc-row:hover { background: var(--bg-secondary, #f8fafc); color: var(--primary-500, #355E3B); }

/* HELPLIST-1683: the viewer's Topic picker, at every width. Desktop: a large centered window (max 1100px, nearly full height). */
.hc-viewer-pick { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.8rem; border-bottom: 1px solid var(--border, #e2e8f0); }
.hc-viewer-pick label { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.hc-viewer-pick select { flex: 1; min-width: 0; max-width: 100%; font-size: 16px; min-height: 40px; padding: 0.3rem 0.5rem; border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px; background: var(--bg-primary, #fff); color: inherit; text-overflow: ellipsis; }
.hc-viewer-box { width: min(1100px, 100%); height: min(94vh, 100%); }
/* HELPLIST-1683: viewer topic picker. Phone layout = width <= 600px (portrait phones) OR a short touch screen, height <= 500px
   (a sideways iPhone is 844x390 / 667x375; width alone would miss it). The touch condition keeps a short desktop window on the buttons. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
    .hc-viewer { padding: 0; }
    .hc-viewer-box { height: 100%; width: 100%; border-radius: 0; }
    .hc-group-body { grid-template-columns: 1fr; }
}
@media (max-height: 500px) and (pointer: coarse) {
    .hc-viewer-bar { padding: 0.3rem 0.8rem; }
    .hc-viewer-bar strong { font-size: 0.9rem; }
}

/* MOBILE-1671 (owner 2026-11-11: no side-scroll on a phone) */
/* a long on-screen label ("Allow patients to pay by card in the patient portal") wraps inside the step card */
.hc-label { white-space: normal; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hc-step > p, .hc-intro, .hc-after, .hc-summary { overflow-wrap: anywhere; }
@media (max-width: 420px) {
    /* the Help Center bar (logo, Help Center, Log In, Start Free Trial) fits a 360 px phone: the logo mark stays, its word goes */
    .hc-site-nav .w-nav-logo span { display: none; }
    .hc-site-nav .w-nav-actions { gap: 0.6rem; }
}
/* The in-app Help pop-up on an iPhone with a notch / Dynamic Island (owner 2026-11-11: the clock sat on the title and the
   x was hard to reach): the pop-up keeps clear of the status bar, the home indicator and the rounded sides. index.html
   asks for viewport-fit=cover, so env(safe-area-inset-*) is the real inset on iOS and 0 everywhere else. */
.hc-viewer {
    padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
             max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
}
@media (max-width: 640px) {
    /* full-screen on a phone: the white box still fills the screen, its bar and frame start below the status bar */
    .hc-viewer { padding: 0; }
    .hc-viewer-box { padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); box-sizing: border-box; }
}
/* HELPLIST-1683: the phone layout (portrait OR sideways) is truly full screen. This sits AFTER the padding rule above (same specificity, later wins),
   which is why the sideways viewer still had its margins. Same query as the topic picker. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
    .hc-viewer { padding: 0; align-items: stretch; justify-content: stretch; inset: 0; }
    .hc-viewer-box { width: 100%; height: 100vh; height: 100dvh; max-height: 100%; border-radius: 0; box-shadow: none; box-sizing: border-box;
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
}

/* CONTACTCARD-1675: Contact ChiroApp card on Help & Support (always the ChiroApp logo green, whatever the practice colour; 44px touch targets, no fixed widths: fits 360px) */
.cc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 0.6rem; }
.cc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0.55rem 0.6rem; box-sizing: border-box;
    border: 1.5px solid #355E3B; border-radius: 12px; background: #355E3B; color: #fff; font: inherit; font-weight: 600;
    font-size: 0.9rem; line-height: 1.2; text-decoration: none; cursor: pointer; text-align: center; overflow-wrap: anywhere; }
.cc-btn[hidden], .cc-line[hidden] { display: none; }
.cc-btn:hover, .cc-btn:focus-visible { filter: brightness(1.1); }
.cc-btn.cc-ghost { background: transparent; color: #355E3B; }
.cc-btn i { font-size: 1.15rem; flex: none; }
.cc-line { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 44px; font-size: 0.9rem; overflow-wrap: anywhere; }
.cc-line span:first-child { min-width: 0; flex: 1 1 auto; }
.cc-copy { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 44px; min-width: 44px; padding: 0 0.7rem; box-sizing: border-box;
    border: 1.5px solid #355E3B; border-radius: 12px; background: transparent; color: #355E3B; font: inherit; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.cc-copy:hover, .cc-copy:focus-visible { background: #355E3B; color: #fff; }

/* HELP-1677 (owner 2026-11-17: users must know Help exists): the new-user tip in the Home welcome card and the one-time
   "Help Center" notice at the top of Home. Inline (never an overlay), wraps at 360px, ChiroApp green. */
.hc-welcome-tip { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--text-secondary, #475569); line-height: 1.45; overflow-wrap: anywhere; }
.hc-welcome-tip i { color: var(--primary-500, #355E3B); margin-right: 0.25rem; }
.hc-notice { display: flex; align-items: flex-start; gap: 0.7rem; margin: 0 0 1rem; padding: 0.8rem 0.95rem; border-radius: 12px;
    border: 1px solid var(--primary-200, #b9d2bd); border-left: 4px solid var(--primary-500, #355E3B); background: var(--bg-primary, #fff);
    box-sizing: border-box; max-width: 100%; overflow-wrap: anywhere; }
.hc-notice > i { color: var(--primary-500, #355E3B); font-size: 1.35rem; margin-top: 0.1rem; flex-shrink: 0; }
.hc-notice-body { flex: 1; min-width: 0; }
.hc-notice-body strong { display: block; font-size: 0.95rem; }
.hc-notice-body p { margin: 0.2rem 0 0; font-size: 0.87rem; color: var(--text-secondary, #475569); line-height: 1.45; }
.hc-notice-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.55rem; }
