:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --primary: #004dfc;
  --primary-foreground: #ffffff;
  --brand: #004dfc;
  --brand-soft: #eef2ff;
  --cf: #ff5e1f;
  --cf-hover: #e94f12;
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.48 0 0);
  --border: oklch(0.922 0 0);
  --accent: oklch(0.68 0.19 45);
  --success: oklch(0.55 0.15 150);
  --danger: oklch(0.55 0.2 27);
  --radius: 0;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.18 0 0);
    --primary: #3d7bff;
    --primary-foreground: #ffffff;
    --brand: #5b8cff;
    --brand-soft: oklch(0.22 0.04 265);
    --muted: oklch(0.22 0 0);
    --muted-foreground: oklch(0.72 0 0);
    --border: oklch(1 0 0 / 12%);
    --success: oklch(0.72 0.15 150);
    --danger: oklch(0.7 0.18 27);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklch, var(--background) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

header.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }

.logo { display: inline-flex; align-items: center; }
.logo img { height: 30px; width: auto; display: block; }
.logo .dark { display: none; }

@media (prefers-color-scheme: dark) {
  .logo .light { display: none; }
  .logo .dark { display: block; }
}

nav.links { display: flex; gap: 20px; margin-left: auto; font-size: 14px; color: var(--muted-foreground); }
nav.links a { text-decoration: none; }
nav.links a:hover { color: var(--foreground); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 0;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-cf { background: var(--cf); color: #fff; }
.btn-cf:hover { background: var(--cf-hover); }
.btn-cf .cf-cloud { width: 26px; height: 13px; fill: currentColor; }
.btn-sm .cf-cloud { width: 22px; height: 11px; }
.btn-pill { background: var(--card); border-color: var(--border); color: var(--foreground); }
.btn-pill:hover { border-color: color-mix(in oklch, var(--foreground) 25%, transparent); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 16px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.hero { padding: 88px 0 72px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 0; padding: 4px 12px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 auto 20px; max-width: 820px; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted-foreground); max-width: 660px; margin: 0 auto 32px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fine { font-size: 13px; color: var(--muted-foreground); margin-top: 16px; }
.fine b { color: var(--foreground); font-weight: 500; }

section { padding: 72px 0; border-top: 1px solid var(--border); }
section h2 { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
section .sub { color: var(--muted-foreground); max-width: 640px; margin: 0 0 40px; font-size: 17px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted-foreground); font-size: 15px; }

.steps { counter-reset: step; }
.steps .card h3::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 0; background: var(--primary); color: var(--primary-foreground); font-size: 13px; }

.card .price { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 8px; }
.card .price small { font-size: 15px; font-weight: 400; color: var(--muted-foreground); }

details { border-bottom: 1px solid var(--border); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details summary::after { content: "+"; color: var(--muted-foreground); }
details[open] summary::after { content: "–"; }
details p { color: var(--muted-foreground); margin: 10px 0 0; max-width: 760px; }

.cta { text-align: center; }
.cta .sub { margin-left: auto; margin-right: auto; }

footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted-foreground); font-size: 14px; }
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer .spacer { flex: 1; }

.banner { margin: 0 auto 24px; max-width: 620px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--muted); font-size: 15px; }

.panel { max-width: 620px; margin: 56px auto; }
.panel h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 8px; }
.panel .sub { margin-bottom: 28px; }
.muted { color: var(--muted-foreground); }

.accounts { display: grid; gap: 10px; margin: 0 0 24px; }
.account { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; background: var(--card); }
.account:has(input:checked) { border-color: var(--foreground); }
.account input { margin-top: 4px; accent-color: var(--primary); }
.account .name { font-weight: 500; }
.account .meta { font-size: 14px; color: var(--muted-foreground); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 0; border: 1px solid var(--border); margin-left: 8px; vertical-align: 2px; }
.badge.ok { color: var(--success); border-color: color-mix(in oklch, var(--success) 40%, transparent); }
.badge.warn { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 40%, transparent); }

label.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
label.field input { height: 40px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--background); color: var(--foreground); padding: 0 12px; font: inherit; font-size: 15px; }
label.field input:focus { outline: 2px solid color-mix(in oklch, var(--foreground) 30%, transparent); outline-offset: 1px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 12px; }

.progress { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.progress li { display: flex; gap: 10px; align-items: center; }
.progress .dot { width: 18px; height: 18px; border-radius: 0; border: 2px solid var(--border); flex: none; display: grid; place-items: center; font-size: 11px; }
.progress li[data-state="running"] .dot { border-color: var(--brand); }
.progress li[data-state="running"] .dot::after { content: ""; width: 8px; height: 8px; background: var(--brand); animation: pixel 1s steps(2, jump-none) infinite; }
.progress li[data-state="done"] .dot { background: var(--success); border-color: var(--success); color: var(--background); }
.progress li[data-state="done"] .dot::after { content: "✓"; }
.progress li[data-state="skipped"] .dot { border-style: dashed; }
.progress li[data-state="failed"] .dot { background: var(--danger); border-color: var(--danger); color: var(--background); }
.progress li[data-state="failed"] .dot::after { content: "!"; }
.progress li[data-state="waiting"] { color: var(--muted-foreground); }

@keyframes pixel { from { opacity: 1; } to { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .progress li[data-state="running"] .dot::after { animation: none; } }

.log-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; background: none; color: var(--muted-foreground); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.log-toggle::before { content: ""; width: 6px; height: 6px; background: var(--brand); }
.log-toggle:hover, .log-toggle[aria-expanded="true"] { color: var(--foreground); }
pre.log { max-height: 320px; overflow: auto; background: var(--muted); border-radius: var(--radius); padding: 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 720px) {
  nav.links a.hide-sm { display: none; }
  .hero { padding: 56px 0 48px; }
  section { padding: 56px 0; }
}

.small { font-size: 12px; margin-top: 2px; }

.guide { --mono: ui-monospace, SFMono-Regular, Menlo, monospace; --dash: color-mix(in oklch, var(--foreground) 18%, transparent); }
.guide-body { max-width: 680px; }
.guide-body h1 { font-weight: 500; line-height: 1.15; }
.guide-kicker { margin: 0 0 12px; font: 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.guide-steps { list-style: none; counter-reset: step; margin: 0 0 32px; padding: 0; border-top: 1px dashed var(--dash); }
.guide-steps li { counter-increment: step; position: relative; padding: 22px 0 22px 52px; border-bottom: 1px dashed var(--dash); }
.guide-steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 24px; font: 13px/1 var(--mono); color: var(--brand); }
.guide-steps h2 { margin: 0 0 6px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.guide-steps p { margin: 0 0 14px; color: var(--muted-foreground); }
.guide-steps p:last-child { margin-bottom: 0; }
.guide-steps b, .guide-note b { color: var(--foreground); font-weight: 500; }
.guide-note { border: 1px solid var(--border); border-left: 3px solid var(--brand); background: var(--card); padding: 18px 20px; }
.guide-note p:last-child { margin: 0; color: var(--muted-foreground); }
.guide-source { font-size: 13px; margin-top: 24px; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }
.label { font: 500 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); margin: 0 0 8px; }
.removes { list-style: none; padding: 0; margin: 0 0 22px; border-top: 1px dashed var(--border); }
.removes li { padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.removes li::before { content: ""; width: 6px; height: 6px; background: var(--danger); flex: none; transform: translateY(-2px); }
.removes.keeps li::before { background: var(--success); }
.removes code, .mono { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.removes .sub-list { color: var(--muted-foreground); font-size: 14px; }
.box { border: 1px solid var(--border); background: var(--card); padding: 16px; margin: 0 0 20px; }
.box p { margin: 0 0 12px; font-size: 15px; }
.box p:last-child { margin-bottom: 0; }
.danger-text { color: var(--danger); }

.kicker { margin: 0 0 12px; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.leave { margin-top: 32px; padding-top: 18px; border-top: 1px dashed color-mix(in oklch, var(--foreground) 18%, transparent); font-size: 14px; color: var(--muted-foreground); }
.leave p { margin: 0 0 8px; }
.leave p:last-child { margin: 0; }
.leave a, .link { color: var(--foreground); }
.link { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.link:disabled { opacity: 0.5; cursor: wait; }

nav.links { align-items: center; gap: 10px; }
details.org-menu { position: relative; border: 0; padding: 0; }
details.org-menu summary { display: inline-flex; justify-content: center; gap: 8px; max-width: 260px; list-style: none; font-weight: 500; color: var(--foreground); }
details.org-menu summary::-webkit-details-marker { display: none; }
details.org-menu summary::after { content: none; }
details.org-menu summary svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.org-menu-name { overflow: hidden; text-overflow: ellipsis; }
.org-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 6px; border: 1px solid var(--border); background: var(--background); box-shadow: 0 8px 24px color-mix(in oklch, oklch(0.145 0 0) 14%, transparent); }
.org-menu-label { margin: 4px 8px 6px; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.org-menu-list .error { margin: 0 8px; min-height: 0; }
.org-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; color: var(--foreground); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.org-item:hover:not(:disabled), .org-item:focus-visible { background: var(--muted); outline: none; }
.org-item:disabled { cursor: default; }
.org-item .org-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-item .org-state { font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.org-item .org-state.todo { color: var(--accent); }
.org-item .org-check { width: 14px; color: var(--brand); text-align: center; }

@media (max-width: 520px) {
  details.org-menu summary { max-width: 150px; }
  .org-menu-list { width: min(280px, calc(100vw - 40px)); }
}
