/* Help (#/help): the page, its step-by-step diagrams, the top-bar help button and the "Show me" spotlight.
   Colours come from the theme tokens in app.css, so light and dark both follow. */

/* ---------- top bar ---------- */
.help-btn { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 999px; border: 1px solid var(--line2); background: var(--field); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .2s, color .2s, box-shadow .2s; }
.help-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.help-btn:hover { border-color: var(--aqua); color: var(--aqua); box-shadow: 0 0 0 4px color-mix(in srgb, var(--aqua) 14%, transparent); }
body.route-help .help-btn { color: var(--aqua); border-color: var(--aqua); }

/* ---------- page ---------- */
.hp { max-width: 1280px; }
.hp svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hp .btn svg { width: 15px; height: 15px; }
.hp .chip svg { width: 13px; height: 13px; flex: 0 0 13px; }
.hp [data-slot] { scroll-margin-top: 66px; }
.hp-toc { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: -6px 0 18px; padding: 8px; border-radius: 999px; background: var(--chrome); border: 1px solid var(--line); backdrop-filter: blur(12px); width: max-content; max-width: 100%; }
.hp-toc a { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; color: var(--ink2); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.hp-toc a:hover { color: var(--ink); background: var(--hover); }

.hp-hero { position: relative; overflow: hidden; text-align: center; padding: 46px 24px 30px; border-radius: 26px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 26px; }
.hp-hero-glow { position: absolute; inset: -40% -10% auto; height: 120%; background: radial-gradient(50% 50% at 30% 30%, color-mix(in srgb, var(--aqua) 26%, transparent), transparent 70%), radial-gradient(45% 45% at 72% 35%, color-mix(in srgb, var(--violet) 26%, transparent), transparent 70%); filter: blur(8px); pointer-events: none; animation: hp-drift 14s ease-in-out infinite alternate; }
@keyframes hp-drift { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }
.hp-hero > * { position: relative; }
.hp-hero h1 { font: 700 clamp(28px, 4vw, 44px)/1.05 var(--display); letter-spacing: -.02em; margin: 10px 0 8px; background: linear-gradient(120deg, var(--ink) 30%, var(--aqua) 60%, var(--violet-ink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-sub { color: var(--ink2); max-width: 640px; margin: 0 auto 22px; font-size: 15px; }
.hp-search { display: flex; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto; height: 58px; padding: 0 16px 0 20px; border-radius: 18px; background: var(--field); border: 1px solid var(--line2); box-shadow: 0 18px 50px color-mix(in srgb, var(--aqua) 12%, transparent); transition: border-color .2s, box-shadow .2s; }
.hp-search:focus-within { border-color: var(--aqua); box-shadow: 0 0 0 5px color-mix(in srgb, var(--aqua) 16%, transparent), 0 18px 50px color-mix(in srgb, var(--aqua) 16%, transparent); }
.hp-search > svg { width: 22px; height: 22px; color: var(--aqua); flex: 0 0 22px; }
.hp-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 16px var(--font); }
.hp-search kbd, .hp-keys kbd { font: 600 11px var(--mono); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line2); color: var(--ink2); background: var(--surface3); }
.hp-popular { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 16px auto 0; max-width: 860px; }
.hp-popular .muted { font-size: 12px; margin-right: 4px; }
.hp-promise { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 12px; color: var(--ink3); }

.hp-results { text-align: left; max-width: 720px; margin: 14px auto 0; border-radius: 16px; border: 1px solid var(--line2); background: var(--surface2); box-shadow: var(--shadow); padding: 8px; max-height: 62vh; overflow: auto; animation: rise .2s ease; }
.hp-best { padding: 14px 16px 16px; margin-bottom: 6px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--aqua) 12%, transparent), color-mix(in srgb, var(--violet) 10%, transparent)); border: 1px solid color-mix(in srgb, var(--aqua) 30%, transparent); }
.hp-best h3 { font: 600 16px var(--display); margin: 6px 0; }
.hp-best p { margin: 0 0 12px; color: var(--ink2); font-size: 13.5px; line-height: 1.55; }
.hp-grp { font: 600 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink3); padding: 10px 10px 4px; }
.hp-hit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.hp-hit:hover, .hp-hit.sel { background: var(--hover); }
.hp-hit.sel { box-shadow: inset 3px 0 0 var(--aqua); }
.hp-hit > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-hit b { font-weight: 600; font-size: 13.5px; }
.hp-hit .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-hit > i svg { width: 15px; height: 15px; color: var(--ink3); }
.hp-hi { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--aqua) 12%, transparent); color: var(--aqua); }
.hp-hi svg { width: 16px; height: 16px; }
.hp-none { padding: 12px; } .hp-none p { margin: 6px 0 0; font-size: 12.5px; }

/* ---------- context (help for the page you were on) ---------- */
.hp-ctx { margin-bottom: 26px; padding: 18px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--aqua) 35%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--aqua) 8%, var(--surface)), var(--surface)); }
.hp-ctx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hp-ctx h2 { font: 700 24px var(--display); margin: 4px 0 0; }
.hp-ctx .hp-page { box-shadow: none; }

/* ---------- you ---------- */
.hp-you { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 30px; }
.hp-next-head { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; position: relative; margin-bottom: 8px; }
.hp-next-head h3 { margin: 0 0 4px; } .hp-next-head p { margin: 0; font-size: 12.5px; }
.hp-ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.hp-ring circle { fill: none; stroke-width: 7; }
.hp-ring .bg { stroke: var(--line); } .hp-ring .fg { stroke: var(--aqua); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--aqua) 50%, transparent)); }
.hp-ring-n { position: absolute; left: 0; top: 50%; width: 72px; transform: translateY(-50%); text-align: center; font: 700 20px var(--display); }
.hp-ring-n span { font: 500 11px var(--font); color: var(--ink3); }
.hp-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-steps li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; }
.hp-steps li:hover { background: var(--hover); }
.hp-steps li > div { display: flex; flex-direction: column; gap: 1px; } .hp-steps b { font-size: 13.5px; font-weight: 600; } .hp-steps .muted { font-size: 12px; }
.hp-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--on-accent); }
.hp-steps li.done .hp-tick { background: var(--green); border-color: var(--green); }
.hp-steps li.done b { color: var(--ink3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink3) 60%, transparent); }
.hp-acts { display: flex; gap: 4px; }
.hp-ai-low { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 6px 0; } .hp-ai-low svg { width: 16px; height: 16px; }
.hp-glance dl { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-gl { display: flex; justify-content: space-between; gap: 12px; padding: 10px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.hp-gl:hover { background: var(--hover); } .hp-gl:last-child { border-bottom: 0; }
.hp-gl dt { color: var(--ink3); font-size: 12.5px; } .hp-gl dd { margin: 0; font-weight: 600; font-size: 13px; text-align: right; }

/* ---------- sections ---------- */
.hp-sec { margin: 0 0 34px; scroll-margin-top: 70px; }
.hp-sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.hp-sec-head h2 { font: 700 26px/1.1 var(--display); margin: 5px 0 0; letter-spacing: -.01em; }
.hp-sec-head p { margin: 0; max-width: 560px; font-size: 13px; }
.hp-h3 { font: 600 16px var(--display); margin: 22px 0 10px; }
#h-ask, #h-you { scroll-margin-top: 70px; }
.hp-waybox { padding: 18px 18px 14px; }
.hp-gpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hp-gcard { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.hp-gcard:hover { transform: translateY(-2px); border-color: var(--line2); }
.hp-gcard.on { border-color: var(--aqua); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aqua) 16%, transparent), var(--shadow-sm); }
.hp-gcard b { font-size: 13.5px; line-height: 1.3; } .hp-gcard .muted { font-size: 11.5px; }
.hp-gi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--aqua); background: color-mix(in srgb, var(--aqua) 12%, transparent); }
.hp-gi svg { width: 18px; height: 18px; }
.hp-gbox { padding: 18px; }
.hp-glead { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.hp-glead h3 { margin: 0; } .hp-glead p { margin: 0; flex: 1; min-width: 220px; font-size: 13px; }

/* ---------- diagrams ---------- */
.hd { outline: none; border-radius: 14px; }
.hd:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--aqua) 40%, transparent); }
.hd-stage { position: relative; margin: 4px 0 14px; }
.hd-wires { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.hd-wire { fill: none; stroke: var(--line2); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.hd-wire.done { stroke: var(--aqua); stroke-dasharray: 9 7; animation: hd-flow 1.1s linear infinite; }
@keyframes hd-flow { to { stroke-dashoffset: -16; } }
.hd-wires marker path { fill: var(--line2); stroke: none; }
.hd-drop { fill: var(--aqua); filter: drop-shadow(0 0 6px var(--aqua)); }
.hd-node { position: absolute; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: 10px; align-content: start; padding: 12px 12px 10px; border-radius: 16px; border: 1px solid var(--line2); background: var(--surface-solid); color: var(--ink); text-align: left; cursor: pointer; transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s, opacity .25s; }
.hd-node:hover { transform: translateY(-2px); border-color: var(--aqua); }
.hd-node.todo { opacity: .78; }
.hd-node.on { border-color: transparent; background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--primary-grad) border-box; border: 2px solid transparent; box-shadow: 0 14px 38px color-mix(in srgb, var(--aqua) 26%, transparent); transform: translateY(-3px) scale(1.02); opacity: 1; }
.hd-num { grid-row: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--mono); background: var(--surface3); color: var(--ink2); }
.hd-node.on .hd-num { background: var(--primary-grad); color: #fff; }
.hd-node.done .hd-num { background: var(--green); color: var(--on-accent); }
.hd-ic { grid-row: 1; justify-self: end; color: var(--aqua); } .hd-ic svg { width: 20px; height: 20px; }
.hd-t { grid-column: 1 / -1; margin-top: 8px; font: 600 13.5px/1.25 var(--display); }
.hd-where { grid-column: 1 / -1; margin-top: 4px; font-size: 11px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-hub { position: absolute; transform: translate(-50%, -50%); width: 190px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.hd-hub svg { width: 46px; height: 46px; stroke: var(--aqua); stroke-width: 4; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--aqua) 50%, transparent)); animation: hd-breathe 3.5s ease-in-out infinite; }
@keyframes hd-breathe { 50% { transform: scale(1.08); } }
.hd-hub b { font: 700 15px var(--display); } .hd-hub span { font-size: 11.5px; color: var(--ink3); }
.hd-back { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12px; color: var(--ink3); }
.hd-panel { border-radius: 14px; padding: 14px 16px; background: var(--surface3); border: 1px solid var(--line); animation: rise .25s ease; }
.hd-p-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hd-p-nav { display: flex; gap: 4px; }
.hd-panel h4 { font: 600 17px var(--display); margin: 8px 0 4px; } .hd-panel p { margin: 0 0 12px; color: var(--ink2); font-size: 13.5px; line-height: 1.55; }
.hd-bar { height: 3px; border-radius: 3px; background: var(--line); margin-top: 14px; overflow: hidden; }
.hd-bar i { display: block; height: 100%; background: var(--primary-grad); transition: width .45s ease; }

/* ---------- every page ---------- */
.hp-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.hp-page { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); padding: 14px; box-shadow: var(--shadow-sm); scroll-margin-top: 80px; transition: border-color .2s; }
.hp-page:hover { border-color: var(--line2); }
.hp-page.open { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--aqua) 40%, transparent); }
.hp-page header { display: grid; grid-template-columns: 38px 1fr; gap: 12px; }
.hp-page h4 { margin: 2px 0 3px; font: 600 15px var(--display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hp-page header p { margin: 0; color: var(--ink2); font-size: 12.8px; line-height: 1.45; }
.hp-pi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--aqua); background: color-mix(in srgb, var(--aqua) 12%, transparent); }
.hp-pi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.hp-pa { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0 50px; }
.hp-det { margin: 14px 0 0 50px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.hp-det h5 { margin: 10px 0 4px; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.hp-det ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; line-height: 1.5; columns: 2 360px; display: block; }
.hp-det li { margin-bottom: 5px; break-inside: avoid; }
.hp-tips li::marker { content: '💡  '; }
.hp-layers { list-style: none; padding-left: 0 !important; }
.hp-layers i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.hp-trial { font-size: 12.5px; margin: 8px 0 0; }
.hp-video { margin-top: 10px; justify-self: start; }
.hp-rel { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hp-link { border: 0; background: none; padding: 3px 0; color: var(--aqua); font: 500 13px var(--font); cursor: pointer; text-align: left; }
.hp-link:hover { text-decoration: underline; }
.hp-page.auto { border-style: dashed; }

/* ---------- questions ---------- */
.hp-cats { margin-bottom: 12px; } .hp-cats svg { width: 13px; height: 13px; }
.hp-qs { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 8px; align-items: start; }
.hp-q { border-radius: 14px; border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 80px; transition: border-color .2s, box-shadow .2s; }
.hp-q.open { border-color: color-mix(in srgb, var(--aqua) 45%, transparent); box-shadow: var(--shadow-sm); }
.hp-qb { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; color: var(--ink); font: 600 13.5px var(--font); text-align: left; cursor: pointer; }
.hp-qb i { font: 400 22px/1 var(--font); color: var(--aqua); font-style: normal; transition: transform .25s; flex: 0 0 auto; }
.hp-q.open .hp-qb i { transform: rotate(45deg); }
.hp-a { padding: 0 16px 14px; animation: rise .2s ease; }
.hp-a p { margin: 0 0 12px; color: var(--ink2); font-size: 13.5px; line-height: 1.6; }
.hp-aa { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hp-vote { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }

/* ---------- more ---------- */
.hp-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hp-more h3 svg { width: 17px; height: 17px; color: var(--aqua); margin-right: auto; order: -1; }
.hp-more h3 { justify-content: flex-start; }
.hp-keys, .hp-vids, .hp-news { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.hp-keys li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.hp-keys kbd { justify-self: start; }
.hp-vids li { display: flex; flex-direction: column; } .hp-vids .muted { font-size: 11.5px; }
.hp-news li { padding-left: 16px; position: relative; } .hp-news li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); }
.hp-more p { font-size: 13px; margin: 0 0 8px; }
.hp-ins { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hp-tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); } .hp-tbl .num { text-align: right; white-space: nowrap; font-family: var(--mono); }

.hp-flash { animation: hp-flash 1.6s ease; }
@keyframes hp-flash { 0%, 100% { box-shadow: var(--shadow-sm); } 25% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--aqua) 45%, transparent), var(--shadow); } }

/* ---------- "Show me" spotlight ---------- */
.hl-ring { position: fixed; z-index: 3000; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 3px var(--aqua), 0 0 26px 6px color-mix(in srgb, var(--aqua) 55%, transparent), 0 0 0 100vmax var(--scrim); animation: hl-pulse 1.6s ease-in-out infinite; }
@keyframes hl-pulse { 50% { box-shadow: 0 0 0 5px var(--aqua), 0 0 40px 10px color-mix(in srgb, var(--aqua) 45%, transparent), 0 0 0 100vmax var(--scrim); } }
.hl-tip { position: fixed; z-index: 3001; max-width: 320px; padding: 12px 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--aqua); box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; gap: 10px; animation: rise .25s ease; }
.hl-tip b { font: 600 14px var(--display); }
.hl-act { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- small screens & calm motion ---------- */
@media (max-width: 1100px) { .hp-you, .hp-ins { grid-template-columns: 1fr; } .hp-qs { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .hp-hero { padding: 30px 14px 22px; border-radius: 20px; }
  .hp-search { height: 52px; } .hp-search kbd { display: none; }
  .hp-pa, .hp-det { margin-left: 0; }
  .hp-det ul { columns: 1; }
  .hp-sec-head h2 { font-size: 22px; }
  .hp-vote { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-hero-glow, .hd-wire.done, .hd-hub svg, .hl-ring { animation: none; }
  .hd-node, .hd-node.on { transition: none; transform: none; }
}
