:root {
  --background: #ffffff; --foreground: #09090b; --muted: #f4f4f5; --muted-foreground: #71717a;
  --border: #e4e4e7; --card: #ffffff; --accent: #2563eb; --radius: 0.5rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 1px 3px rgb(0 0 0 / 0.06);
}
@media (prefers-color-scheme: dark) {
  :root { --background: #09090b; --foreground: #fafafa; --muted: #18181b; --muted-foreground: #a1a1aa; --border: #27272a; --card: #0f0f12; --accent: #60a5fa; }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 50rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
header.top { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
header.top img { width: 2.5rem; height: 2.5rem; }
header.top .name { font-weight: 600; font-size: 1.125rem; flex: 1 1 auto; color: inherit; text-decoration: none; }
nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: var(--radius); text-decoration: none; color: var(--foreground); }
nav a:hover, nav a:focus-visible { background: var(--muted); }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.2; margin: 0 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
.lead { font-size: 1.125rem; color: var(--muted-foreground); margin: 0 0 1.5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--foreground); text-decoration: none; font-weight: 500; box-shadow: var(--shadow); }
.btn.primary { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.btn:focus-visible, nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.card p { margin: 0; color: var(--muted-foreground); font-size: 0.9375rem; }
.kbd { font: 500 0.8125rem ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 0.25rem; padding: 0.05rem 0.35rem; background: var(--muted); white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.muted { color: var(--muted-foreground); }
footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--muted-foreground); }
.table-wrap { overflow-x: auto; }

/* ---- Welcome page (welcome/index.html) ---- */
:root { --ok: #16a34a; --ok-soft: #dcfce7; --warn-soft: #fef3c7; --warn: #92400e; }
@media (prefers-color-scheme: dark) { :root { --ok: #4ade80; --ok-soft: #052e16; --warn-soft: #422006; --warn: #fcd34d; } }
svg.i { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.2em; }
svg.i.inline { width: 1rem; height: 1rem; }
button.btn { font: inherit; font-weight: 500; cursor: pointer; }
.btn svg.i { margin-right: 0.5rem; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted-foreground); }
.btn.ghost:hover { background: var(--muted); }
.actions.tight { margin-bottom: 0.5rem; }
.small { font-size: 0.875rem; }
.step { border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.5); background: var(--card); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.step-head { display: flex; align-items: center; gap: 0.75rem; }
.step-head h2 { margin: 0; font-size: 1.125rem; }
.step-num { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--foreground); color: var(--background); font-weight: 600; }
.step-num .ok { display: none; }
.step.is-done .step-num { background: var(--ok); color: #fff; }
.step.is-done .step-num .n { display: none; }
.step.is-done .step-num .ok { display: block; }
.step-body { margin-top: 0.75rem; }
.step-body > p:first-child, .step-body > div > p:first-child { margin-top: 0; }
/* welcome.js shows exactly the .show-<state> blocks of the current state via [hidden] */
[hidden] { display: none !important; }
body[data-state="checking"] [class*="show-"]:not(.show-checking) { display: none; } /* before welcome.js runs */
.done-line, .notice { display: flex; }
.done-line { align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--ok-soft); color: var(--foreground); }
.done-line > svg.i { color: var(--ok); }
.notice { align-items: flex-start; gap: 0.5rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.waiting { display: flex; align-items: center; gap: 0.5rem; }
.pin-steps { padding-left: 1.25rem; margin: 1rem 0; }
.pin-steps li { margin-bottom: 0.375rem; }
/* illustration: a Chrome toolbar with the Extensions menu open */
.pin-demo { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); padding: 0.75rem 0.75rem 1rem; max-width: 34rem; overflow: hidden; }
.tb { display: flex; align-items: center; gap: 0.375rem; }
.tb-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--border); flex: none; }
.tb-url { flex: 1 1 auto; min-width: 0; margin: 0 0.25rem; padding: 0.375rem 0.75rem; border-radius: 999px; background: var(--card); color: var(--muted-foreground); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { position: relative; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--foreground); }
.hl { box-shadow: 0 0 0 2px var(--accent); background: var(--card); }
.menu { margin: 0.75rem 0 0 auto; width: min(100%, 17rem); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); padding: 0.5rem; }
.menu-title { font-size: 0.8125rem; color: var(--muted-foreground); padding: 0.25rem 0.5rem; }
.menu-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem; border-radius: calc(var(--radius) - 2px); background: var(--muted); font-size: 0.875rem; }
.menu-row img { width: 1.25rem; height: 1.25rem; }
.menu-row > span:not(.pin) { flex: 1 1 auto; }
.pin { position: relative; width: 1.875rem; height: 1.875rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.badge-n { display: inline-flex; align-items: center; justify-content: center; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 700; flex: none; }
.tb-btn .badge-n, .pin .badge-n { position: absolute; top: -0.375rem; right: -0.375rem; }
/* step 2 */
.inline-icon { width: 1.25rem; height: 1.25rem; vertical-align: -0.25em; }
.try { display: block; margin-top: 0.5rem; }
.modes { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.modes li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 0.75rem; row-gap: 0.375rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); }
.modes li > div { min-width: 0; display: flex; flex-direction: column; }
.modes li span:not(.kbd) { color: var(--muted-foreground); font-size: 0.9375rem; }
.modes li .kbd { flex: none; }
.card h3 { display: flex; align-items: center; gap: 0.5rem; }
.step-body .grid { margin-bottom: 1rem; }
@media (max-width: 30rem) {
  .step { padding: 1rem; }
  .modes li { grid-template-columns: auto 1fr; align-items: start; }
  .modes li > svg.i { margin-top: 0.2rem; }
  .modes li .kbd { grid-column: 2; justify-self: start; }
  .tb-dot { display: none; }
}
