/* Personal Device Bridge — help center (/{lang}/help/). Loaded after style.css on help pages
 * only and built from the same tokens, so it follows light/dark mode and the language fonts. */

.help { padding-bottom: 88px; }
.help code { font-family: var(--mono); font-size: .88em; padding: .1em .4em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); overflow-wrap: anywhere; }
.help strong { color: var(--text); font-weight: 650; }

/* ---------- hub hero + search ---------- */
.help-hero { position: relative; overflow: hidden; padding: 36px 0 56px; text-align: center; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.help-hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; background:
  radial-gradient(520px 260px at 85% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
  radial-gradient(420px 220px at 5% 100%, color-mix(in srgb, var(--success) 10%, transparent), transparent 70%); }
.help-hero > .container { position: relative; z-index: 1; }
.help-hero .crumbs ol { justify-content: center; }
.help-hero h1 { margin-top: 26px; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.2rem); font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.help-hero .lead { margin: 14px auto 0; }

.help-search { position: relative; display: flex; align-items: center; gap: 8px; margin: 28px auto 0; max-width: 680px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); text-align: left; transition: border-color .15s, box-shadow .15s; }
.help-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); }
.help-search-icon { color: var(--muted); display: grid; place-items: center; }
.help-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.02rem; }
.help-search input:focus { outline: none; }
.help-search input::placeholder { color: var(--muted); opacity: 1; }
.help-search input::-webkit-search-cancel-button { cursor: pointer; }
.help-kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font: 600 .8rem var(--mono); }
.help-search:focus-within .help-kbd { visibility: hidden; }
.help-search-btn { flex: none; }
@media (max-width: 560px) {
  .help-kbd { display: none; }
  .help-search-lg .help-search-btn { padding: 6px 14px; }
}

/* results (inside the form so arrow-key navigation stays in one widget) */
.help-results { position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 30; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.help-search-lg .help-results { position: static; margin-top: 0; box-shadow: none; border: 0; background: transparent; padding: 0; max-height: none; overflow: visible; }
.help-search-lg { flex-wrap: wrap; }
.help-search-lg .help-results { flex-basis: 100%; order: 10; }
.help-hero .help-search-lg:has(.help-results:not([hidden])) { border-radius: var(--r-lg); padding-bottom: 12px; }
.help-results-status { padding: 8px 10px 6px; font-size: .88rem; color: var(--muted); }
.help-results-list { list-style: none; display: grid; gap: 4px; }
.help-result { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.help-result:hover, .help-result:focus-visible { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); outline-offset: 0; }
.help-result strong { font-size: 1rem; }
.help-result-cat { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); }
:lang(ko) .help-result-cat, :lang(ja) .help-result-cat, :lang(zh-CN) .help-result-cat, :lang(zh-TW) .help-result-cat { letter-spacing: 0; }
.help-result-snip { font-size: .88rem; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.help-result mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; }

.help-offline-banner { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .88rem; }

/* ---------- hub body ---------- */
.help-body { padding-top: 56px; }
.help-block { margin-bottom: 56px; }
.help-block-title { font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 18px; }
.help-cards { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.help-card { display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.help-card:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.help-card-icon, .help-cat-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.help-card-text { display: grid; gap: 2px; min-width: 0; }
.help-card-text strong { font-size: 1rem; letter-spacing: -0.01em; }
.help-card-text span { font-size: .88rem; color: var(--text-2); line-height: 1.5; }
.help-card-go { margin-left: auto; color: var(--muted); width: 18px; height: 18px; transition: transform .15s, color .15s; }
.help-card:hover .help-card-go { color: var(--accent-ink); transform: translateX(2px); }
.help-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.help-cat { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 16px); }
.help-cat:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.help-cat-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.help-cat-head h3 { font-size: 1.08rem; margin-bottom: 4px; }
.help-cat-head p { color: var(--text-2); font-size: .9rem; line-height: 1.5; }
#cat-trouble .help-cat-icon { background: var(--success-soft); color: var(--success-ink); }
.help-links { list-style: none; display: grid; gap: 2px; margin: 0 -8px; }
.help-links a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: .94rem; line-height: 1.4; }
.help-links a .i { color: var(--muted); flex: none; }
.help-links a:hover { background: var(--surface-2); color: var(--text); }
.help-links a:hover .i { color: var(--accent-ink); }
@media (max-width: 1024px) { .help-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .help-cards, .help-cats { grid-template-columns: 1fr; } .help-body { padding-top: 40px; } }

/* ---------- contact / offline ---------- */
.help-contact { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-top: 48px; padding: 24px 26px; border-radius: var(--r-lg); background: radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg-soft); border: 1px solid var(--border); }
.help-contact-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); }
.help-contact h2 { font-size: 1.15rem; margin-bottom: 4px; }
.help-contact p { color: var(--text-2); font-size: .94rem; }
.help-contact-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-ghost .i { width: 18px; height: 18px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.help-offline-status { grid-column: 1 / -1; min-height: 0; font-size: .9rem; color: var(--success-ink); font-weight: 600; }
.help-offline-status:empty { display: none; }
@media (max-width: 760px) {
  .help-contact { grid-template-columns: auto minmax(0, 1fr); }
  .help-contact-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- article ---------- */
.help-wrap { padding-top: 32px; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; margin-top: 24px; }
.help-doc { min-width: 0; max-width: 760px; }
.help-kicker a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-weight: 700; font-size: .85rem; text-decoration: none; letter-spacing: .02em; }
.help-kicker a:hover { text-decoration: underline; }
.help-head h1 { margin-top: 10px; font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.help-summary { margin-top: 12px; font-size: 1.1rem; color: var(--text-2); text-wrap: pretty; }
.help-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--border); font-size: .86rem; color: var(--muted); }
.help-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.help-platforms ul { display: inline-flex; flex-wrap: wrap; gap: 4px; list-style: none; }
.help-platforms li { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .78rem; }
.help-intro { margin-top: 24px; font-size: 1.05rem; color: var(--text-2); }
.help-section { margin-top: 36px; scroll-margin-top: calc(var(--header-h) + 16px); }
.help-section > h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin-bottom: 14px; }
.help-section > p { color: var(--text-2); margin-bottom: 12px; overflow-wrap: anywhere; }
.help-section > ul { margin: 0 0 14px 1.2em; display: grid; gap: 8px; color: var(--text-2); overflow-wrap: anywhere; }
.help-section > ul li::marker { color: var(--accent); }

.help-steps { list-style: none; display: grid; gap: 0; position: relative; }
.help-steps li { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding-bottom: 22px; scroll-margin-top: calc(var(--header-h) + 16px); }
.help-steps li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: linear-gradient(var(--accent-soft-2), var(--border)); }
.help-step-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: .95rem; box-shadow: 0 0 0 5px var(--accent-soft); }
.help-steps h3 { font-size: 1.05rem; margin: 6px 0 6px; letter-spacing: -0.01em; }
.help-steps p { color: var(--text-2); overflow-wrap: anywhere; }
.help-steps li:target .help-step-num { background: var(--success); box-shadow: 0 0 0 5px var(--success-soft); }

.help-note { display: flex; gap: 12px; margin-top: 32px; padding: 16px 18px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: var(--accent-soft); color: var(--text); }
.help-note .i { color: var(--accent-ink); margin-top: 3px; }
.help-article .faq { margin-top: 4px; }

/* sidebar */
.help-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 22px; }
.help-side .help-search { margin: 0; max-width: none; padding: 4px 4px 4px 12px; box-shadow: none; }
.help-side .help-search input { font-size: .95rem; min-height: 40px; }
.help-side .help-search-btn { display: none; }
.help-side .help-search.is-live .help-kbd { display: inline-grid; }
.help-toc, .help-related { padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
.help-toc h2, .help-related h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
:lang(ko) .help-toc h2, :lang(ko) .help-related h2, :lang(ja) .help-toc h2, :lang(ja) .help-related h2, :lang(zh-CN) .help-toc h2, :lang(zh-CN) .help-related h2, :lang(zh-TW) .help-toc h2, :lang(zh-TW) .help-related h2 { letter-spacing: .02em; }
.help-toc ol { list-style: none; display: grid; gap: 2px; border-left: 2px solid var(--border); }
.help-toc a { display: block; margin-left: -2px; padding: 5px 0 5px 12px; border-left: 2px solid transparent; color: var(--text-2); text-decoration: none; font-size: .9rem; line-height: 1.4; }
.help-toc a:hover { color: var(--text); border-left-color: var(--accent); }
.help-related ul { list-style: none; display: grid; gap: 2px; margin: 0 -8px 8px; }
.help-related li a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: .9rem; line-height: 1.4; }
.help-related li a:hover { background: var(--surface-2); color: var(--text); }
.help-related .text-link { font-size: .9rem; }

@media (max-width: 1024px) {
  /* One column: the sidebar's search moves above the article, related links below it. */
  .help-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .help-side { display: contents; }
  .help-side .help-search { order: -1; }
  .help-toc { display: none; }
  .help-related { order: 2; }
}
@media (max-width: 640px) {
  .help-wrap { padding-top: 20px; }
  .help-steps li { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .help-step-num { width: 30px; height: 30px; font-size: .85rem; }
  .help-steps li:not(:last-child)::before { left: 14px; top: 34px; }
}

@media print {
  .help-side, .help-contact, .help-search, .crumbs { display: none !important; }
  .help-layout { display: block; }
  .help-step-num { box-shadow: none; border: 1px solid #000; color: #000; background: #fff; }
}
