/* The help site's one stylesheet. Colours and type follow the app (src/theme/tokens.css) so the help reads like the product. */
:root {
  color-scheme: light dark;
  --text: #1f2328; --text-2: #4b5563; --muted: #6b7280; --faint: #9ca3af;
  --line: #e5e7eb; --line-soft: #eef0f3;
  --bg: #fbfbfc; --surface: #ffffff; --tint: #f3f4f6; --hover: #f1f3f6;
  --accent: #3d6a9e; --accent-text: #33598a; --accent-soft: #e8eff8; --accent-line: #c6d6ea;
  --code: #f1f3f6; --code-text: #b3471f;
  --callout: #fff8e6; --callout-line: #f1dfb0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -16px rgba(16, 24, 40, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e8eb; --text-2: #c2c7cf; --muted: #9aa3ae; --faint: #6b7380;
    --line: #2b3038; --line-soft: #242930;
    --bg: #131519; --surface: #1a1d22; --tint: #22262d; --hover: #252a32;
    --accent: #8fb4de; --accent-text: #9dc0e6; --accent-soft: #1e2a3a; --accent-line: #34527a;
    --code: #23272e; --code-text: #f0a37a;
    --callout: #2a2519; --callout-line: #4a3f22;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -16px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Noto Sans KR Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; font-size: 14px; line-height: 1.75; -webkit-font-smoothing: antialiased }
:lang(ko) { word-break: keep-all }
a { color: var(--accent-text); text-decoration: none }
a:hover { text-decoration: underline; text-underline-offset: 3px }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px }
.skip { position: absolute; left: -9999px; top: 8px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px }
.skip:focus { left: 8px; z-index: 10 }

/* Header: the same bar as the app's tool pages (.dev-reports-topbar) — brand with a small line under it, quiet links on the right. */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; padding: 0 22px; background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line) }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text) }
.brand:hover { text-decoration: none }
.brand img { width: 30px; height: 30px; display: block; object-fit: contain }
.brand b, .brand small { display: block; line-height: 1.3 }
.brand b { font-size: 13px; font-weight: 700 }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px }
.top-links { display: flex; align-items: center; gap: 4px; font-size: 11px }
.top-links a { display: flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 6px; color: var(--accent-text) }
.top-links a:hover { background: var(--accent-soft); text-decoration: none }
.languages { display: inline-flex; margin-right: 6px; padding-right: 8px; border-right: 1px solid var(--line) }
.languages select { height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer }
.languages select:hover { border-color: var(--accent-line); color: var(--text) }
.languages select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }

/* Three columns */
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr) 200px; gap: 40px; width: min(1180px, 100%); margin: 0 auto; padding: 28px 24px 64px }
.site-nav { font-size: 13px }
.nav-fold { position: sticky; top: 82px; max-height: calc(100vh - 98px); overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; scrollbar-width: thin }
.nav-fold > summary { display: none }
.site-nav ul { margin: 0; padding: 0; list-style: none }
.site-nav > details > ul > li { margin: 0 0 18px }
.site-nav > details > ul > li:first-child { margin-bottom: 22px }
.site-nav b { display: block; margin: 0 0 4px; padding: 0 10px; color: var(--text); font-size: 12px; font-weight: 700 }
.site-nav b a { display: inline; padding: 0; color: inherit; font: inherit; border: 0; background: none }
.site-nav a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--text-2); line-height: 1.5 }
.site-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none }
.site-nav ul ul { margin: 2px 0 0 10px; padding-left: 4px; border-left: 1px solid var(--line) }
.site-nav ul ul a { position: relative; padding-left: 12px }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600 }
.site-nav ul ul a[aria-current="page"]::before { content: ''; position: absolute; left: -5px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent) }
.site-nav b a[aria-current="page"] { background: none; color: var(--accent-text) }
.site-nav a[lang="ko"]:lang(en), .site-nav a[lang="en"]:lang(ko) { color: var(--muted) }

/* Article */
main { min-width: 0; max-width: 720px }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--muted); font-size: 12px }
.crumbs a { color: var(--muted) }
.crumbs a:hover { color: var(--text) }
article { padding: 32px 36px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow) }
article h1 { margin: 0 0 8px; font-size: 27px; line-height: 1.25; font-weight: 750; letter-spacing: -.02em }
.lead { margin: 0 0 24px; font-size: 15px; line-height: 1.65; color: var(--text-2) }
.untranslated { display: flex; gap: 8px; margin: 0 0 18px; padding: 9px 12px; border: 1px solid var(--callout-line); border-radius: 10px; background: var(--callout); color: var(--text-2); font-size: 13px }
.untranslated::before { content: 'ⓘ'; color: var(--muted) }
article h2 { margin: 36px 0 10px; padding-top: 4px; font-size: 19px; line-height: 1.35; font-weight: 700; letter-spacing: -.015em }
article h3 { margin: 26px 0 8px; font-size: 16px; font-weight: 700 }
article h4 { margin: 18px 0 6px; font-size: 14px; font-weight: 700 }
article h1 + h2, .lead + h2, .untranslated + h2 { margin-top: 12px }
article :is(h1, h2, h3, h4) { scroll-margin-top: 78px }
article p, article ul, article ol, article table, article figure, article pre, article blockquote { margin: 12px 0 }
article p:last-child { margin-bottom: 0 }
article ul, article ol { padding-left: 26px }
article li { margin: 5px 0; padding-left: 2px }
article li::marker { color: var(--muted) }
article li > ul, article li > ol { margin: 4px 0 }
article li > p { margin: 0 }
article strong { font-weight: 700 }
article img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px }
article figure { margin: 18px 0 }
article figcaption { margin-top: 6px; color: var(--muted); font-size: 12px }
article code { padding: 2px 6px; border-radius: 6px; background: var(--code); color: var(--code-text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em }
article pre { padding: 12px 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--code); font-size: 12.5px; line-height: 1.65 }
article pre code { padding: 0; background: none; color: inherit }
article blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent-line); color: var(--text-2) }
.table-wrap { margin: 16px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px }
article table { width: 100%; margin: 0; border-collapse: collapse; font-size: 13px; line-height: 1.6 }
article th, article td { padding: 9px 12px; border-top: 1px solid var(--line-soft); text-align: left; vertical-align: top }
article th { border-top: 0; background: var(--tint); color: var(--text-2); font-weight: 600; font-size: 12px }
article tr:first-child td { border-top: 0 }
article td:first-child, article th:first-child { padding-left: 16px }
article hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line) }
.nested-blocks { margin-left: 24px }
.callout { display: flex; gap: 10px; margin: 16px 0; padding: 12px 14px; border: 1px solid var(--callout-line); border-radius: 12px; background: var(--callout) }
.callout-emoji { flex: none; font-size: 16px; line-height: 1.5 }
.callout > div { min-width: 0; color: var(--text) }
.callout > div > p:first-child { margin-top: 0 }
.callout > div > p:last-child { margin-bottom: 0 }
article details { margin: 12px 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface) }
article summary { margin: 0 -16px; padding: 12px 16px 12px 40px; position: relative; cursor: pointer; font-weight: 600; list-style: none }
article summary::-webkit-details-marker { display: none }
article summary::before { content: ''; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s }
article details[open] > summary::before { transform: rotate(45deg); margin-top: -8px }
article details[open] > summary { border-bottom: 1px solid var(--line-soft) }
article details > :not(summary):first-of-type { margin-top: 12px }
article details > :last-child { margin-bottom: 14px }
article input[type="checkbox"] { vertical-align: middle }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--tint); font-family: inherit; font-size: .88em }

/* Previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; font-size: 13px }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 600 }
.pager a:hover { border-color: var(--accent-line); text-decoration: none; box-shadow: var(--shadow) }
.pager small { color: var(--muted); font-size: 12px; font-weight: 500 }
.pager .next { grid-column: 2; text-align: right }

/* On this page */
.page-toc { font-size: 12px }
.page-toc .toc { position: sticky; top: 82px }
.page-toc b { display: block; margin: 0 0 8px; color: var(--text); font-size: 12px; font-weight: 700 }
.page-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line) }
.page-toc li { margin: 0 }
.page-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.page-toc a:hover { color: var(--text); border-left-color: var(--faint); text-decoration: none }
.page-toc .toc-3 a { padding-left: 24px }

/* Notice pages (404) */
.notice { width: min(560px, calc(100% - 32px)); margin: 12vh auto; padding: 40px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: center }
.notice h1 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.01em }
.notice p { margin: 0; color: var(--text-2) }

/* Footer */
.bottom { width: min(1180px, 100%); margin: 0 auto; padding: 0 24px 48px; color: var(--muted); font-size: 12px }
.bottom p { margin: 6px 0 }
.bottom a { color: var(--muted) }
.bottom a:hover { color: var(--text) }
.bottom p:last-child a + a { margin-left: 14px }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 32px }
  .page-toc { display: none }
  main { max-width: none }
}
@media (max-width: 760px) {
  .top { height: 52px; padding: 0 10px 0 16px }
  .brand b { white-space: nowrap }
  .brand small { display: none }
  .top-links { gap: 0; flex: none }
  .top-links a { padding: 6px 7px; white-space: nowrap }
  .top-links a[href="/about"], .top-links .feedback-link { display: none }
  .languages { margin-right: 2px; padding-right: 2px }
  .layout { display: block; padding: 16px 16px 40px }
  .site-nav { margin: 0 0 16px }
  .nav-fold { position: static; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow) }
  .nav-fold > summary { display: block; position: relative; padding: 12px 16px 12px 40px; cursor: pointer; font-weight: 600; list-style: none }
  .nav-fold > summary::-webkit-details-marker { display: none }
  .nav-fold > summary::before { content: ''; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg) }
  .nav-fold[open] > summary { border-bottom: 1px solid var(--line-soft) }
  .nav-fold[open] > summary::before { transform: rotate(45deg); margin-top: -8px }
  .nav-fold > ul { padding: 12px 10px 6px }
  article { padding: 24px 18px 28px; border-radius: 12px }
  article h1 { font-size: 23px }
  .lead { font-size: 14px }
  article h2 { margin-top: 30px; font-size: 18px }
  .pager { grid-template-columns: 1fr }
  .pager .next { grid-column: auto; text-align: left }
}

.install-app { margin: 1.5rem 0; }
.install-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.install-choice[hidden] { display: none; }
.install-choice span { color: var(--muted); font-size: 14px; }
.install-button { display: inline-block; padding: .65rem 1rem; border: 1px solid currentColor; border-radius: .5rem; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.install-button:disabled { opacity: .6; cursor: default; }
#install-status { margin: .6rem 0 0; font-size: 14px; }

.ask-ai { margin: 0 0 1.5rem; padding: 14px 18px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); }
article .ask-ai h2 { margin: 0 0 6px; padding: 0; font-size: 17px; }
.ask-ai p { margin: 6px 0; }
.ask-ai-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ask-ai-link a { overflow-wrap: anywhere; font-weight: 600; }
.ask-ai-link .install-button { padding: .45rem .9rem; font-size: 14px; }
.ask-ai-example { color: var(--text-2); font-size: 14px; }
#ask-ai-status { margin: 4px 0 0; font-size: 14px; }
#ask-ai-status:empty { display: none; }
