/* Styles of the docs pages (docs.html, docs-<lang>.html). */
:root {
  --ink: #0f172a;        /* slate-900: headings */
  --text: #475569;       /* slate-600: body */
  --muted: #64748b;      /* slate-500 */
  --line: #e2e8f0;       /* slate-200 */
  --line-soft: #f1f5f9;  /* slate-100 */
  --bg-soft: #f8fafc;    /* slate-50 */
  --blue: #2563eb;       /* blue-600 */
  --blue-dark: #1d4ed8;  /* blue-700 */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --header-h: 64px;
  --font: "Plus Jakarta Sans", Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7;
  color: var(--text); background: #fff; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--blue); color: #fff; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 16px; }

/* ---------- Header (matches the homepage's scrolled header) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255,255,255,.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,.5); box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.header-in { position: relative; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand, .nav-actions { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
/* Centered between the logo and the buttons, like the homepage's nav */
.main-nav { flex: 1; display: flex; justify-content: center; align-items: center; gap: 20px; white-space: nowrap; }
@media (min-width: 1280px) { .main-nav { gap: 32px; } }
/* The language button shows only the globe until there is room for the name */
@media (max-width: 1279px) { .lang-name { display: none; } }
.main-nav > a, .nav-dd-btn { color: var(--text); font-size: 14px; font-weight: 500; transition: color .15s; }
.main-nav > a:hover, .nav-dd-btn:hover { color: #3b82f6; text-decoration: none; }
.main-nav > a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-dd { position: relative; }
.nav-dd-btn { display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.nav-dd-btn svg { transition: transform .2s; }
.nav-dd:hover .nav-dd-btn svg, .nav-dd:focus-within .nav-dd-btn svg { transform: rotate(180deg); }
.nav-dd-panel { visibility: hidden; opacity: 0; position: absolute; left: 50%; top: 100%; z-index: 20; width: 176px; transform: translateX(-50%); padding-top: 12px; transition: opacity .15s, visibility .15s; }
.nav-dd:hover .nav-dd-panel, .nav-dd:focus-within .nav-dd-panel { visibility: visible; opacity: 1; }
.nav-dd-menu { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 0; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.nav-dd-menu a { display: block; padding: 8px 16px; color: var(--text); font-size: 14px; font-weight: 500; }
.nav-dd-menu a:hover { background: var(--bg-soft); color: var(--blue); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-pill {
  display: inline-block; padding: 8px 20px; border-radius: 9999px; font-size: 14px; font-weight: 600; white-space: nowrap;
  background: var(--blue); color: #fff; box-shadow: 0 10px 15px -3px rgba(59,130,246,.3), 0 4px 6px -4px rgba(59,130,246,.3);
  transition: transform .15s, background-color .15s;
}
.btn-pill:hover { text-decoration: none; transform: scale(1.05); background: var(--blue-dark); color: #fff; }
.btn-pill:active { transform: scale(.95); }
.lang-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9999px; font-size: 14px; font-weight: 600;
  background: var(--line-soft); color: #334155; transition: transform .15s, background-color .15s;
}
.lang-pill:hover { text-decoration: none; transform: scale(1.05); background: var(--line); color: #334155; }
.lang-pill:active { transform: scale(.95); }
.mobile-menu a.mobile-lang { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 0; background: var(--line-soft); color: #334155; border-radius: 8px; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.mobile-menu { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border-bottom: 1px solid #f3f4f6; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { color: var(--text); font-size: 16px; font-weight: 500; padding: 8px 0; }
.mobile-menu a:hover { color: var(--blue); text-decoration: none; }
.mobile-menu a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.mobile-sep { height: 1px; background: #f3f4f6; margin: 4px 0; }
.mobile-menu a.mobile-buy { text-align: center; padding: 12px 0; background: var(--blue); color: #fff; border-radius: 8px; }
@media (max-width: 1023px) {
  .main-nav, .nav-actions { display: none; }
  .menu-toggle { display: block; }
}

/* ---------- Page title ---------- */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line-soft); padding: 48px 0 40px; }
.eyebrow { color: var(--blue); font-weight: 600; font-size: 14px; letter-spacing: .02em; margin: 0 0 8px; }
.page-head h1 { color: var(--ink); font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.page-head p { margin: 0; max-width: 680px; font-size: 18px; }

/* ---------- Layout ---------- */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding-top: 40px; padding-bottom: 96px; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
.toc-group { margin: 0 0 20px; }
.toc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; padding-left: 14px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; padding: 6px 14px; border-left: 2px solid var(--line); color: var(--text);
  font-size: 14px; font-weight: 500; line-height: 1.45;
}
.toc a:hover { color: var(--ink); text-decoration: none; border-left-color: #cbd5e1; }
.toc a.is-active { color: var(--blue); border-left-color: var(--blue); background: var(--blue-50); font-weight: 600; }
.toc-mobile { display: none; }

.content { max-width: 780px; min-width: 0; }
.content section { scroll-margin-top: calc(var(--header-h) + 24px); padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line-soft); }
.content section:last-child { border-bottom: 0; margin-bottom: 0; }
.content h2 { color: var(--ink); font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; margin: 0 0 16px; }
.content h3 { color: var(--ink); font-size: 19px; line-height: 1.35; font-weight: 700; margin: 36px 0 10px; scroll-margin-top: calc(var(--header-h) + 24px); }
.content p { margin: 0 0 16px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; }
.content li { margin: 0 0 6px; }
.lead { font-size: 18px; }
.ui { color: var(--ink); font-weight: 600; }  /* interface labels: keep in sync with the extension's English strings */
code { font-family: var(--mono); font-size: .86em; background: var(--line-soft); color: var(--ink); padding: 2px 6px; border-radius: 6px; word-break: break-word; }
pre { background: var(--ink); color: #e2e8f0; padding: 16px 18px; border-radius: 12px; overflow-x: auto; margin: 0 0 16px; font-size: 14px; line-height: 1.6; }
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.anchor { opacity: 0; margin-left: 8px; color: #cbd5e1; font-weight: 500; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.anchor:hover { color: var(--blue); text-decoration: none; }

.badge-pro {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 1px 9px; border-radius: 9999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.6;
  color: var(--blue-dark); background: var(--blue-50); border: 1px solid var(--blue-100);
}
h3 .badge-pro { font-size: 11px; }

/* Steps */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { position: relative; padding-left: 44px; margin-bottom: 14px; counter-increment: step; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-50); color: var(--blue-dark); border: 1px solid var(--blue-100);
  font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--bg-soft); color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.c, th.c { text-align: center; white-space: nowrap; }
.reg-table td:first-child { width: 90px; color: var(--ink); font-weight: 600; }
.reg-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2px 0 2px; }
.reg-label + code { display: inline-block; margin-bottom: 8px; word-break: break-all; }
.method-table td:first-child { width: 190px; color: var(--ink); font-weight: 600; }
.method-table code { word-break: break-all; }
.tag { display: inline-block; margin-top: 4px; padding: 0 8px; border-radius: 9999px; font-size: 12px; font-weight: 600; line-height: 1.7; color: var(--muted); background: var(--line-soft); white-space: nowrap; }
.yes { color: #16a34a; font-weight: 700; }
.no { color: #94a3b8; }

/* Callouts and cards */
.note { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 12px; padding: 14px 18px; margin: 0 0 20px; color: #1e3a8a; }
.note p:last-child { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin: 0 0 20px; }
.card { border: 1px solid var(--line-soft); border-radius: 16px; padding: 20px 22px; box-shadow: 0 4px 20px -2px rgba(0,0,0,.05); }
.card h4 { margin: 0 0 6px; color: var(--ink); font-size: 16px; font-weight: 700; }
.card p { margin: 0; font-size: 15px; }
.store-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.btn-outline { display: inline-block; padding: 9px 18px; border-radius: 9999px; border: 1px solid #cbd5e1; color: var(--ink); font-size: 14px; font-weight: 600; background: #fff; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

/* FAQ */
.faq { margin: 0 0 8px; }
.faq dt { color: var(--ink); font-weight: 700; margin: 0 0 4px; }
.faq dd { margin: 0 0 18px; }

.help-box { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 16px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.help-box p { margin: 0; }
.help-box strong { color: var(--ink); display: block; font-size: 17px; }

/* ---------- Footer (matches the homepage) ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 48px 0; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 18px; }
.footer-brand img { width: 32px; height: 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; font-weight: 500; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--blue); text-decoration: none; }
.copyright { margin: 0; font-size: 14px; color: #94a3b8; }

/* ---------- Narrow screens ---------- */
@media (max-width: 960px) {
  .wrap { padding: 0 20px; }
  .docs { grid-template-columns: minmax(0,1fr); gap: 0; padding-top: 0; }
  .toc { display: none; }
  .toc-mobile {
    display: block; position: sticky; top: var(--header-h); z-index: 40; margin: 0 -20px 28px; padding: 10px 20px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .toc-mobile select { width: 100%; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
  .content section { scroll-margin-top: calc(var(--header-h) + 76px); }
  .content h3 { scroll-margin-top: calc(var(--header-h) + 76px); }
  .page-head { padding: 32px 0 28px; }
  .page-head h1 { font-size: 32px; }
  .content h2 { font-size: 26px; }
  .cards { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 560px) {
  .method-table thead, .reg-table thead { display: none; }
  .method-table tr, .reg-table tr { display: block; border-bottom: 1px solid var(--line-soft); padding: 12px 14px; }
  .method-table tr:last-child, .reg-table tr:last-child { border-bottom: 0; }
  .method-table td, .reg-table td { display: block; width: auto !important; padding: 0; border: 0; }
  .method-table td:first-child, .reg-table td:first-child { margin-bottom: 6px; }
  th, td { padding: 10px 12px; }
}

/* ---------- Language menu ---------- */
.lang-dd { position: relative; }
.lang-dd .lang-pill { border: 0; font-family: inherit; cursor: pointer; }
.lang-dd .lang-pill svg:last-child { transition: transform .2s; }
.lang-dd:hover .lang-pill svg:last-child, .lang-dd:focus-within .lang-pill svg:last-child { transform: rotate(180deg); }
.lang-dd .nav-dd-panel { left: auto; right: 0; width: 208px; transform: none; padding-top: 8px; }
.lang-dd:hover .nav-dd-panel, .lang-dd:focus-within .nav-dd-panel { visibility: visible; opacity: 1; }
.nav-dd-menu a[aria-current="true"] { color: var(--blue); }
.mobile-langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mobile-menu .mobile-langs a { text-align: center; padding: 10px 0; font-size: 14px; background: var(--line-soft); color: #334155; border-radius: 8px; }
.mobile-menu .mobile-langs a[aria-current="true"] { background: var(--blue-50); color: var(--blue-dark); }

/* ---------- Fonts for CJK languages ---------- */
:root:lang(zh-CN) { --font: "Plus Jakarta Sans", Inter, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica, Arial, sans-serif; }
:root:lang(zh-TW) { --font: "Plus Jakarta Sans", Inter, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", Roboto, Helvetica, Arial, sans-serif; }
:root:lang(ja) { --font: "Plus Jakarta Sans", Inter, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, "Noto Sans JP", Roboto, Helvetica, Arial, sans-serif; }
:root:lang(ko) { --font: "Plus Jakarta Sans", Inter, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Roboto, Helvetica, Arial, sans-serif; }
