/* ==========================================================================
   MechVy Help Centre — styles
   1. Design tokens   2. Base   3. Layout   4. Header/footer   5. Hero + search
   6. Topic tiles / rows   7. Article   8. States + skeletons   9. Utilities
   ========================================================================== */

/* ---- 1. Design tokens --------------------------------------------------- */
:root {
  /* Brand */
  --navy: #0F3D75;          /* hero / header */
  --navy-deep: #0B2D57;
  --brand: #2B7FD1;         /* brand info blue: fills, borders, icons (not small text) */
  --orange: #FF5A1F;        /* sparingly: primary CTA fill, active marker, thin rule. NEVER small text. */

  /* Surfaces & text (light) */
  --bg: #FFFFFF;
  --surface: #EAF3FC;       /* pale blue */
  --surface-2: #F5F9FD;
  --text: #14202E;
  --text-muted: #4B5B6D;
  --border: #D3E0EE;
  --link: #1A5FA8;          /* AA on white/surface; brand blue is only ~4:1 */
  --link-hover: #0F3D75;
  --focus: #1A5FA8;
  --on-orange: #14202E;     /* dark text on orange (white on orange is only ~3:1) */
  --field-bg: #FFFFFF;
  --field-text: #14202E;
  --field-muted: #4B5B6D;
  --mark-bg: #FDE68A;
  --mark-text: #14202E;
  --warn-bg: #FFF1E8;
  --warn-icon: #A63500;
  --step-bg: #0F3D75;
  --step-text: #FFFFFF;
  --on-navy: #FFFFFF;
  --vote-on-bg: #0F3D75;     /* H4: pressed Yes/No button */
  --vote-on-text: #FFFFFF;
  --danger-text: #A3231B;
  --danger-bg: #FDECEA;
  --danger-border: #E8A39D;
  --on-navy-muted: #CFE2F7;
  --chip-navy-bg: #1D5290;
  --skel-a: #E3ECF6;
  --skel-b: #F1F6FB;
  --shadow: 0 1px 2px rgba(15, 61, 117, .08), 0 4px 16px rgba(15, 61, 117, .06);
  --shadow-pop: 0 8px 32px rgba(11, 45, 87, .22);

  /* Scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --radius: 10px; --radius-lg: 16px;
  --t: 120ms ease;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-brand: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --header-h: 64px;
}

/* Dark tokens apply with the system preference, unless the page is forced light
   (data-theme="light"), or when forced dark (data-theme="dark"). The attribute is
   set from the workshop app's theme on handoff — see js/session.js applyTheme(). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0B2D57;
    --navy-deep: #081F3E;
    --bg: #0E1620;
    --surface: #16263A;
    --surface-2: #121E2E;
    --text: #E8EEF5;
    --text-muted: #A9B8C9;
    --border: #26384F;
    --link: #7DB8F2;
    --link-hover: #B5D6F8;
    --focus: #8CC4FF;
    --field-bg: #101C2B;
    --field-text: #E8EEF5;
    --field-muted: #A9B8C9;
    --mark-bg: #7A5C00;
    --mark-text: #FFFFFF;
    --warn-bg: #2B1D14;
    --warn-icon: #FF9B73;
    --step-bg: #7DB8F2;
    --step-text: #0E1620;
    --vote-on-bg: #7DB8F2;
    --vote-on-text: #0E1620;
    --danger-text: #FFB4AB;
    --danger-bg: #3A1B19;
    --danger-border: #7A3A35;
    --chip-navy-bg: #17467F;
    --skel-a: #1A2C42;
    --skel-b: #223750;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-pop: 0 8px 32px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
    --navy: #0B2D57;
    --navy-deep: #081F3E;
    --bg: #0E1620;
    --surface: #16263A;
    --surface-2: #121E2E;
    --text: #E8EEF5;
    --text-muted: #A9B8C9;
    --border: #26384F;
    --link: #7DB8F2;
    --link-hover: #B5D6F8;
    --focus: #8CC4FF;
    --field-bg: #101C2B;
    --field-text: #E8EEF5;
    --field-muted: #A9B8C9;
    --mark-bg: #7A5C00;
    --mark-text: #FFFFFF;
    --warn-bg: #2B1D14;
    --warn-icon: #FF9B73;
    --step-bg: #7DB8F2;
    --step-text: #0E1620;
    --vote-on-bg: #7DB8F2;
    --vote-on-text: #0E1620;
    --danger-text: #FFB4AB;
    --danger-bg: #3A1B19;
    --danger-border: #7A3A35;
    --chip-navy-bg: #17467F;
    --skel-a: #1A2C42;
    --skel-b: #223750;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-pop: 0 8px 32px rgba(0, 0, 0, .55);
}

/* ---- 2. Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
#app { display: flex; flex-direction: column; min-height: 100vh; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
mark { background: var(--mark-bg); color: var(--mark-text); border-radius: 3px; padding: 0 1px; }
.muted { color: var(--text-muted); }
.icon { flex: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 100; background: var(--bg); color: var(--link); border: 2px solid var(--focus); border-radius: 8px; padding: 12px 16px; font-weight: 600; transition: top var(--t); }
.skip-link:focus { top: 12px; }

/* ---- 3. Layout ----------------------------------------------------------------- */
.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 24px; } }
.main { flex: 1 0 auto; outline: none; overflow-wrap: anywhere; } /* long unbreakable strings must never cause horizontal scroll */
.main.is-entering { animation: fade-in var(--t) both; }
.page { padding-block: var(--s-5) var(--s-7); }
.page--home { padding-top: var(--s-6); }
.section { margin-top: var(--s-7); }
.section:first-child { margin-top: 0; }
.section__title { font-size: 1.375rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; margin-bottom: var(--s-4); }
.page-title { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.page-lead { color: var(--text-muted); font-size: 1.0625rem; margin-top: var(--s-2); max-width: 60ch; }
.page-head { display: flex; gap: var(--s-4); align-items: flex-start; margin: var(--s-4) 0 var(--s-6); }
.page-head__icon { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--surface); color: var(--link); display: grid; place-items: center; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- 4. Header / footer ------------------------------------------------------------ */
.site-header { background: var(--navy); color: var(--on-navy); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; gap: var(--s-4); min-height: var(--header-h); flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--on-navy); text-decoration: none; border-radius: 8px; }
.brand:hover { color: var(--on-navy); }
.brand__mark { display: block; width: 28px; height: auto; }
.brand__logo { display: block; height: 30px; width: auto; }
.brand__logo + .brand__word { padding-left: 12px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.35); line-height: 1; }
.brand__word { font-family: var(--font-brand); font-weight: 600; letter-spacing: .12em; font-size: 1.125rem; display: inline-flex; gap: .45em; align-items: baseline; }
.brand__help { font-weight: 500; color: var(--on-navy-muted); }
.site-header__search { margin-left: auto; width: min(100%, 380px); }
.site-header :focus-visible, .hero :focus-visible { outline-color: #FFFFFF; }
body.is-home .site-header__search, body.is-search .site-header__search { display: none; }
@media (max-width: 699px) {
  .site-header__search { order: 3; width: 100%; margin-left: 0; }
}
.site-footer { margin-top: var(--s-8); border-top: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: .9375rem; }
.site-footer__inner { padding-block: var(--s-5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); }

/* ---- 5. Hero + search ----------------------------------------------------------------- */
.hero { background: var(--navy); color: var(--on-navy); padding-block: var(--s-6) var(--s-7); }
@media (min-width: 768px) { .hero { padding-block: var(--s-7) 56px; } }
.hero__eyebrow { display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .12em; font-size: .8125rem; font-weight: 600; color: var(--on-navy-muted); margin-bottom: var(--s-3); }
.hero__eyebrow::before { content: ''; width: 28px; height: 3px; border-radius: 2px; background: var(--orange); }
.hero__title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); line-height: 1.1; font-weight: 700; letter-spacing: -.025em; max-width: 18ch; }
.hero__lead { color: var(--on-navy-muted); font-size: 1.125rem; margin: var(--s-3) 0 var(--s-5); }
.hero__suggest { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--on-navy-muted); font-size: .9375rem; }
.hero__inner { max-width: 1160px; }
.hero .search { max-width: 720px; }

.search { position: relative; width: 100%; }
.search__field { display: flex; align-items: center; gap: 8px; background: var(--field-bg); color: var(--field-text); border: 1px solid var(--border); border-radius: 12px; padding: 0 6px 0 14px; min-height: 48px; transition: box-shadow var(--t), border-color var(--t); }
.search__field:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.hero .search__field:focus-within, .site-header .search__field:focus-within { outline-color: #FFFFFF; }
.search__icon { color: var(--field-muted); }
.search__input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--field-text); font-size: 1rem; outline: none; padding: 0 4px; -webkit-appearance: none; appearance: none; }
.search__input::placeholder { color: var(--field-muted); opacity: 1; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search--large .search__field { min-height: 60px; border-radius: 14px; box-shadow: var(--shadow-pop); }
.search--large .search__input { font-size: 1.125rem; min-height: 56px; }
.search--large .search__btn { min-width: 96px; }
.site-header .search__btn { display: none; }
.search__panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); max-height: min(70vh, 460px); overflow-y: auto; padding: 6px; }
.search__option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 10px; cursor: pointer; border-left: 3px solid transparent; }
.search__option.is-active { background: var(--surface); border-left-color: var(--orange); }
.search__option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.search__option-title { font-weight: 600; overflow-wrap: anywhere; }
.search__option-cat { font-size: .8125rem; color: var(--text-muted); }
.search__option-chev { color: var(--text-muted); }
.search__option--all .search__option-title { color: var(--link); }
.search__message { padding: 14px 14px 12px; color: var(--text); }
.search__none-hint { color: var(--text-muted); margin-top: 4px; }
.search-page__box { margin: var(--s-4) 0 var(--s-6); max-width: 720px; }
.search-page__box .search__field { box-shadow: none; border-color: var(--text-muted); }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background var(--t), border-color var(--t), transform var(--t); }
.btn--primary { background: var(--orange); color: var(--on-orange); }
.btn--primary:hover { background: #FF7440; color: var(--on-orange); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--link); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface); color: var(--link-hover); }
.chip { max-width: 100%; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--link); text-decoration: none; font-size: .9375rem; font-weight: 500; transition: background var(--t); }
.chip:hover { background: var(--bg); color: var(--link-hover); }
.chip--on-navy { background: var(--chip-navy-bg); color: var(--on-navy); border-color: var(--chip-navy-bg); }
.chip--on-navy:hover { background: #2563AA; color: var(--on-navy); }

/* ---- 6. Topic tiles / rows / breadcrumbs ---------------------------------------------------- */
.tiles { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: var(--text); min-height: 88px; transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.tile:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text); }
.tile__icon { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); color: var(--link); display: grid; place-items: center; }
.tile__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile__name { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.tile__desc { color: var(--text-muted); font-size: .9375rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile__count { color: var(--text-muted); font-size: .8125rem; font-weight: 500; margin-top: 2px; }
@media (min-width: 1000px) { .tile { flex-direction: column; gap: var(--s-3); padding: var(--s-5) var(--s-4); } }

.rows { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); }
.rows > li + li { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: var(--s-4); padding: 14px var(--s-4) 14px var(--s-5); min-height: 64px; text-decoration: none; color: var(--text); border-left: 3px solid transparent; transition: background var(--t), border-color var(--t); }
.row:hover { background: var(--surface-2); border-left-color: var(--orange); color: var(--text); }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row__title { font-weight: 600; font-size: 1.0625rem; line-height: 1.35; overflow-wrap: anywhere; }
.row__summary { color: var(--text-muted); font-size: .9375rem; overflow-wrap: anywhere; }
.row__cat { font-size: .8125rem; color: var(--text-muted); font-weight: 500; }
.row__chev { color: var(--text-muted); }
.results-count { color: var(--text-muted); margin-bottom: var(--s-3); }
.rows--results .row { align-items: flex-start; }
.rows--results .row__chev { margin-top: 4px; }

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs a, .crumbs span { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; }
.crumbs a { min-width: 44px; padding-inline: 4px; }
.crumbs span { color: var(--text-muted); max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs__sep { color: var(--text-muted); margin-inline: 4px; }

/* ---- 7. Article ------------------------------------------------------------------------------ */
.article-layout { display: block; margin-top: var(--s-3); }
@media (min-width: 1100px) { .article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; } }
.article { min-width: 0; max-width: 760px; }
.article__head { padding-bottom: var(--s-5); border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); position: relative; }
.article__head::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 56px; height: 3px; border-radius: 2px; background: var(--orange); }
.article__title { font-size: clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }
.article__summary { font-size: 1.25rem; line-height: 1.5; color: var(--text-muted); margin-top: var(--s-3); overflow-wrap: anywhere; }
.article__body { font-size: clamp(1.0625rem, 1.02rem + .2vw, 1.125rem); line-height: 1.65; }
.article__body > * + * { margin-top: var(--s-4); }
.article__h { font-weight: 700; letter-spacing: -.015em; line-height: 1.25; scroll-margin-top: 24px; overflow-wrap: anywhere; }
h2.article__h { font-size: 1.5rem; margin-top: var(--s-7); }
h3.article__h { font-size: 1.25rem; margin-top: var(--s-6); }
.article__body > .article__h:first-child { margin-top: 0; }
.article__p { white-space: pre-line; overflow-wrap: anywhere; }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: var(--s-5); }
.step { counter-increment: step; display: flex; gap: var(--s-4); }
.step::before { content: counter(step); flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--step-bg); color: var(--step-text); font-weight: 700; font-size: 1rem; display: grid; place-items: center; margin-top: 1px; }
.step__body { flex: 1; min-width: 0; }
.step__text { white-space: pre-line; overflow-wrap: anywhere; padding-top: 4px; }
.step__figure, .figure { margin: var(--s-3) 0 0; }
.figure { margin-top: var(--s-5); }
.step__img, .figure__img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
figcaption { color: var(--text-muted); font-size: .9375rem; margin-top: var(--s-2); }
.img-fallback { display: flex; align-items: center; gap: 8px; padding: var(--s-4); border-radius: var(--radius); border: 1px dashed var(--border); background: var(--surface-2); color: var(--text-muted); font-size: .9375rem; overflow-wrap: anywhere; }
.callout { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--radius); border-left: 4px solid var(--brand); background: var(--surface); font-size: 1rem; line-height: 1.6; }
.callout > .icon { margin-top: 2px; color: var(--link); }
.callout > div { min-width: 0; }
.callout__label { font-weight: 700; margin-bottom: 2px; }
.callout__text { white-space: pre-line; overflow-wrap: anywhere; }
.callout--warning { background: var(--warn-bg); border-left-color: var(--orange); }
.callout--warning > .icon { color: var(--warn-icon); }
.callout--tip { background: var(--surface-2); border-left-color: var(--navy); border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.video-link { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4); min-height: 64px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); text-decoration: none; color: var(--link); }
.video-link:hover { background: var(--surface); border-color: var(--brand); }
.video-link__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.video-link__title { font-weight: 600; overflow-wrap: anywhere; }
.video-link__host { color: var(--text-muted); font-size: .875rem; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s-6); }
.article__meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .9375rem; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.related { max-width: 760px; }
.article__aside { display: none; }
@media (min-width: 1100px) { .article__aside { display: block; position: sticky; top: 24px; } }
.toc { border-left: 1px solid var(--border); padding-left: var(--s-4); }
.toc__title { font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--text-muted); margin-bottom: var(--s-2); }
.toc__links { display: flex; flex-direction: column; }
.toc__link { display: flex; align-items: center; min-height: 44px; padding: 8px 0 8px 12px; margin-left: -17px; border-left: 3px solid transparent; color: var(--text-muted); text-decoration: none; font-size: .9375rem; line-height: 1.35; overflow-wrap: anywhere; transition: color var(--t), border-color var(--t); }
.toc__link:hover { color: var(--link-hover); }
.toc__link--l3 { padding-left: 26px; font-size: .875rem; }
.toc__link[aria-current] { color: var(--text); font-weight: 600; border-left-color: var(--orange); }


/* ---- H4. "Was this article helpful?" + footer data note ---------------------------------------- */
.site-footer__privacy { flex-basis: 100%; margin: 0; font-size: .875rem; }
.helpful { margin-top: var(--s-6); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.helpful__title { font-size: 1.125rem; font-weight: 700; margin: 0 0 var(--s-3); }
.helpful__buttons { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn--vote { min-width: 104px; min-height: 48px; background: var(--bg); color: var(--text); border-color: var(--text-muted); }
.btn--vote:hover:not(:disabled) { background: var(--surface); border-color: var(--link); color: var(--text); }
.btn--vote[aria-pressed="true"], .btn--vote[aria-pressed="true"]:hover:not(:disabled) { background: var(--vote-on-bg); color: var(--vote-on-text); border-color: var(--vote-on-bg); }
.btn--vote:disabled { opacity: .65; cursor: progress; }
.helpful__body { margin-top: var(--s-4); }
.helpful__msg { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 var(--s-3); font-weight: 600; }
.helpful__msg-icon { flex: none; margin-top: 2px; color: var(--link); }
.helpful__link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--link); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.helpful__link:hover { color: var(--link-hover); }
.helpful__prompt { display: block; font-weight: 600; margin-bottom: var(--s-2); }
.helpful__textarea { display: block; width: 100%; box-sizing: border-box; min-height: 104px; padding: 12px 14px; border: 1px solid var(--text-muted); border-radius: 10px; background: var(--field-bg); color: var(--field-text); font: inherit; line-height: 1.5; resize: vertical; }
.helpful__textarea::placeholder { color: var(--field-muted); opacity: 1; }
.helpful__formrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-2); flex-wrap: wrap; }
.helpful__count { color: var(--text-muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.helpful__links { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.helpful__support:empty { display: none; }
.helpful__error { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger-text); font-weight: 600; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: .9375rem; }
.helpful__error .btn--ghost { color: var(--danger-text); border-color: var(--danger-border); }
.helpful__error .btn--ghost:hover { background: transparent; color: var(--danger-text); border-color: var(--danger-text); }

/* ---- 8. States + skeletons ----------------------------------------------------------------------- */
.state { max-width: 560px; margin: var(--s-7) auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.state--inline, .state--empty { margin: var(--s-5) auto var(--s-6); padding: var(--s-6) var(--s-5); border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface-2); max-width: 100%; }
.state__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--link); display: grid; place-items: center; }
.state__title { font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.state__title--sm { font-size: 1.25rem; }
.state__text { color: var(--text-muted); max-width: 46ch; }
.state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-2); }
.notice { display: flex; align-items: center; gap: 10px; margin-top: var(--s-5); padding: var(--s-3) var(--s-4); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.notice .icon { color: var(--link); }
.nowrap-wrap { overflow-wrap: anywhere; }

.skel { background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 50%, var(--skel-a) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel--line { height: 14px; margin-top: 12px; }
.skel--title { height: 40px; width: min(70%, 420px); margin-top: var(--s-4); }
.skel--crumb { height: 18px; width: 220px; margin-top: 13px; }
.skel--block { height: 160px; margin-top: var(--s-5); border-radius: var(--radius); }
.skel--row { height: 64px; border-radius: 0; }
.skel--tile { height: 108px; border-radius: var(--radius-lg); }
@media (min-width: 1000px) { .skel--tile { height: 160px; } }
.skel-list { margin-top: var(--s-5); display: flex; flex-direction: column; gap: 2px; border-radius: var(--radius-lg); overflow: hidden; }

/* ---- 9. Motion preference ------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- 10. Phase H2: context bar + link-failure notice ------------------------------------ */
.context-bar { background: var(--navy-deep); color: var(--on-navy); border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9375rem; }
.context-bar__inner { display: flex; align-items: center; gap: 8px; min-height: 40px; padding-block: 6px; }
.context-bar__icon { color: var(--on-navy-muted); }
.context-bar__label { min-width: 0; overflow-wrap: anywhere; }
.context-bar__label strong { font-weight: 700; }
.notice-bar { background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--border); }
.notice-bar__inner { display: flex; align-items: center; gap: 12px; padding-block: 8px; }
.notice-bar__text { flex: 1; min-width: 0; font-size: .9375rem; }
.notice-bar__close { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.notice-bar__close:hover { background: var(--surface); }

/* Help Admin preview banner (H3): always visible while an unpublished preview is shown. */
.preview-bar { background: var(--warn-bg); color: var(--text); border-bottom: 3px solid #E0A100; position: sticky; top: 0; z-index: 40; }
.preview-bar__inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; padding-block: 8px; font-size: .9375rem; }
.preview-bar__icon { flex: none; }
.preview-bar__text { min-width: 0; overflow-wrap: anywhere; }
.preview-bar[hidden] { display: none; }

/* ---- 10. Contact Support (Phase H5) --------------------------------------
   Orange is used ONLY by .btn--primary (the form's submit and "Back to Help"). Everything else uses the
   neutral/blue tokens above so contrast holds in both themes. */
.site-footer__links { flex-basis: 100%; margin: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__links a:hover { color: var(--link-hover); }
.site-footer__links a[hidden] { display: none; }

.support-cta { margin-top: var(--s-7); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); }
@media (min-width: 700px) { .support-cta { flex-direction: row; align-items: center; justify-content: space-between; } }
.support-cta__title { margin: 0 0 var(--s-1); font-size: 1.25rem; font-weight: 700; }
.support-cta__lead { margin: 0; color: var(--text-muted); max-width: 60ch; }
.support-cta .btn { flex: none; min-height: 48px; }
.helpful__support { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.helpful__stuck { margin: 0; font-weight: 600; }

.page-head--tight { margin-bottom: var(--s-5); }
.support-card { max-width: 720px; padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
@media (max-width: 479px) { .support-card { padding: var(--s-4); } }
.support-form { display: flex; flex-direction: column; gap: var(--s-5); }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__label { font-weight: 600; }
.field__control { display: block; width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 14px; border: 1px solid var(--text-muted); border-radius: 10px; background: var(--field-bg); color: var(--field-text); font: inherit; line-height: 1.5; }
.field__control--area { min-height: 104px; resize: vertical; }
.field__control::placeholder { color: var(--field-muted); opacity: 1; }
.field__control[aria-invalid="true"] { border-color: var(--danger-text); border-width: 2px; }
.field__foot { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.field__error { margin: 0; color: var(--danger-text); font-weight: 600; font-size: .9375rem; }
.field__error:empty { display: none; }
.field__count { margin-left: auto; color: var(--text-muted); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.include { margin: 0; color: var(--text-muted); font-size: .9375rem; }
.include__chip { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.form-banner { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger-text); font-weight: 600; display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-start; }
.form-banner[hidden], .form-banner__actions[hidden] { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.form-actions .btn--primary { min-height: 52px; }
.form-actions .btn:disabled { opacity: .7; cursor: progress; }
.form-banner .btn--ghost { color: var(--danger-text); border-color: var(--danger-border); }
.form-banner .btn--ghost:hover { background: transparent; color: var(--danger-text); border-color: var(--danger-text); }

.state__icon--ok { background: var(--surface); color: var(--link); }
.state__ref { margin: 0; color: var(--text-muted); }
.state__ref .ref, .req__ref { display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--surface); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.support-how { text-align: left; margin: var(--s-2) 0 0; padding-left: 1.25rem; color: var(--text-muted); max-width: 46ch; }
.support-how li { margin-bottom: var(--s-2); }

.req-list { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: flex; flex-direction: column; gap: var(--s-3); max-width: 720px; }
.req { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.req__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.req__cat { margin: var(--s-2) 0 0; font-weight: 600; }
.req__meta, .req__article { margin: var(--s-1) 0 0; color: var(--text-muted); font-size: .9375rem; }
.req__article a { color: var(--link); font-weight: 600; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .875rem; font-weight: 600; }
.status-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.status-chip[data-status="resolved"]::before, .status-chip[data-status="closed"]::before { background: var(--text-muted); }
.status-chip[data-status="waiting_for_user"] { border-color: var(--link); }
.requests-note { max-width: 720px; color: var(--text-muted); }

/* Interactive tutorial button on an article */
.tour-cta { margin: 0 0 1.25rem; padding: 14px 16px; border: 1px solid var(--border, #e3e6ea); border-radius: 12px; background: var(--surface, #fff); }
.tour-cta__btn { margin-right: 8px; }
.tour-cta__hint { color: var(--muted, #667); font-size: .95rem; }
