:root {
  --bg: #ffffff; --bg2: #f7f7fb; --fg: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #4f46e5; --accent-2: #4338ca; --code-bg: #0f172a; --code-fg: #e2e8f0;
  --err: #b91c1c; --ok-bg: #ecfdf5; --ok-fg: #065f46;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0d12; --bg2: #12151d; --fg: #e5e7eb; --muted: #9ca3af; --line: #252a36;
    --accent: #818cf8; --accent-2: #a5b4fc; --code-bg: #0f1420; --err: #f87171; --ok-bg: #052e22; --ok-fg: #6ee7b7; }
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif }
a { color: var(--accent) }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em }
:not(pre) > code { background: var(--bg2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px }
pre { background: var(--code-bg); color: var(--code-fg); padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.5; margin: 0 0 16px }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px }
.narrow { max-width: 760px }
.muted { color: var(--muted) } .small { font-size: 14px } .center { text-align: center }
.nav { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5 }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px }
.nav nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap }
.nav nav a:not(.btn) { color: var(--fg); text-decoration: none; font-size: 15px }
.nav nav a:not(.btn):hover { color: var(--accent) }
.logo { font-weight: 700; font-size: 19px; color: var(--fg); text-decoration: none; white-space: nowrap }
.logo-mark { color: var(--accent) }
.btn { display: inline-block; background: var(--accent); color: #fff !important; border: 0; border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s }
.btn:hover { background: var(--accent-2) }
.btn:disabled { opacity: .6; cursor: wait }
.btn-sm { padding: 6px 12px; font-size: 14px } .btn-lg { padding: 13px 24px; font-size: 17px }
.btn-ghost { background: transparent; color: var(--fg) !important; border: 1px solid var(--line) }
.btn-ghost:hover { background: var(--bg2) }
.hero { padding: 64px 0 40px; text-align: center }
.hero h1 { font-size: clamp(36px, 6vw, 58px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -1px }
.accent { color: var(--accent) }
.lead { font-size: 19px; color: var(--muted); max-width: 720px; margin: 0 auto 26px }
.page .lead { margin-left: 0 } .page .center.lead { margin: 0 auto 26px }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px }
.code-tabs { max-width: 780px; margin: 34px auto 0; text-align: left }
.tabs { display: flex; gap: 4px; margin-bottom: 8px }
.tab { background: none; border: 1px solid transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 14px }
.tab.active { border-color: var(--line); color: var(--fg); background: var(--bg2) }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; padding-top: 30px; padding-bottom: 50px }
.feature { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; background: var(--bg2) }
.feature h3 { margin: 0 0 6px; font-size: 18px } .feature p { margin: 0; color: var(--muted) }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 26px 0 }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column }
.plan-hl { border: 2px solid var(--accent) }
.plan h3 { margin: 0 } .price { font-size: 38px; font-weight: 800; margin: 6px 0 } .price span { font-size: 15px; font-weight: 400; color: var(--muted) }
.plan ul { padding-left: 18px; margin: 10px 0 20px; flex: 1 } .plan li { margin: 4px 0 }
.plan form, .plan .btn { width: 100%; text-align: center } .plan form .btn { width: 100% }
.faq { padding-bottom: 60px } .faq details { border-bottom: 1px solid var(--line); padding: 14px 0; max-width: 760px; margin: 0 auto }
.faq summary { cursor: pointer; font-weight: 600 } .faq p { color: var(--muted); margin: 8px 0 0 }
.page { padding-top: 40px; padding-bottom: 60px }
.prose { padding-bottom: 60px } .prose h2 { margin-top: 36px }
.form { display: grid; gap: 14px; max-width: 420px }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 600 }
input, select, textarea { font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; min-width: 0 }
textarea { resize: vertical } input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px }
.error { color: var(--err); font-weight: 600 }
.notice { background: var(--ok-bg); color: var(--ok-fg); padding: 12px 16px; border-radius: 9px }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 18px; background: var(--bg) }
.card h3 { margin-top: 0 }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin: 14px 0 }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap }
.bar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line) }
.bar div { height: 100%; background: var(--accent) }
.keys { list-style: none; padding: 0 } .keybox pre { user-select: all }
.docs table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 15px; display: block; overflow-x: auto }
.docs th, .docs td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top }
.docs td:first-child { white-space: nowrap }
.inv-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start }
.inv-form h3 { margin: 18px 0 8px }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 34px; gap: 6px; margin-bottom: 6px }
.item-row .x { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 8px; cursor: pointer; font-size: 18px }
.inv-preview-wrap { position: sticky; top: 80px }
#preview { width: 100%; aspect-ratio: 1 / 1.414; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 6px }
.footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--bg2) }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 28px }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 14px }
@media (max-width: 860px) {
  .inv-layout { grid-template-columns: 1fr } .inv-preview-wrap { position: static }
  .nav nav a:not(.btn) { display: none } .nav nav a[href="/docs"], .nav nav a[href="/login"] { display: inline }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px }
  .grid2, .grid3 { grid-template-columns: 1fr }
  .item-row { grid-template-columns: minmax(0, 1fr) 56px 84px 30px }
  .hero { padding-top: 40px }
}
