/* ===== tokens ===== */
/* Light by default (blue accent); dark only when chosen with the theme toggle. */
:root {
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-soft: #eef4ff;
  --brand-ink: #1d4ed8;
  --on-brand: #ffffff;
  --bg: #f5f8fd;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --text: #1e293b;
  --text-2: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #edf1f7;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --warn: #c2410c;
  --warn-soft: #fff4ec;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(30, 64, 175, .04);
  --shadow: 0 1px 3px rgba(30, 64, 175, .06), 0 1px 2px rgba(30, 64, 175, .03);
  --shadow-lg: 0 18px 40px -18px rgba(30, 64, 175, .25);
  --radius: 12px;
  --radius-sm: 8px;
  --grad: linear-gradient(135deg, #2563eb, #4f46e5);
  --dark-card: linear-gradient(135deg, #2563eb, #4338ca); /* account plan card */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #60a5fa; --brand-2: #818cf8; --brand-soft: #172554; --brand-ink: #bfdbfe; --on-brand: #0b1220;
  --bg: #0b1220; --bg-2: #0f172a; --surface: #111a2e; --surface-2: #1a2540; --text: #e2e8f0; --text-2: #a5b4cf;
  --muted: #7d8bab; --line: #22304d; --line-2: #1b2742; --ok: #4ade80; --ok-soft: #0f2a1c; --warn: #fbbf24;
  --warn-soft: #2b2210; --danger: #f87171; --danger-soft: #2f1616; --code-bg: #070d1a; --code-text: #dbe4f3;
  --grad: linear-gradient(135deg, #3b82f6, #6366f1); --dark-card: linear-gradient(135deg, #1e3a8a, #312e81);
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 16px 40px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ===== base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { vertical-align: middle; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, pre, kbd, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--surface-2); border: 1px solid var(--line-2); padding: .05em .4em; border-radius: 6px; font-size: .88em; }
pre { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
[x-cloak] { display: none !important; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ===== navbar ===== */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; height: 64px; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.08rem; color: var(--text); letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--text-2); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: .94rem; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.lang-btn:hover { color: var(--text); background: var(--surface-2); }
.lang-caret { opacity: .6; }
.menu-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; font-size: .9rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; font-size: .8rem; text-transform: uppercase; flex-shrink: 0; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.menu-head b { display: block; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: none; }
.announce { background: var(--brand-soft); color: var(--brand-ink); border-bottom: 1px solid color-mix(in srgb, var(--brand) 12%, transparent); text-align: center; font-size: .84rem; padding: 7px 16px; }
.announce a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ===== buttons ===== */
.btn { font: inherit; font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; text-decoration: none !important; line-height: 1.3; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: transparent; color: var(--on-brand); box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
.btn.sm { padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn.lg { padding: 13px 24px; font-size: 1rem; border-radius: 12px; }
.btn.block { width: 100%; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== cards / badges ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 20px; }
.grid-2 > .card, .grid-3 > .card, .ed-grid > .card, .db-grid > .card, .plans > .card, .stats > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.xdb { background: #fff1e6; color: #c2410c; }
.badge.mmdb { background: var(--brand-soft); color: var(--brand-ink); }
.badge.qzdb { background: #e6f6f4; color: #0f766e; }
:root[data-theme="dark"] .badge.xdb { background: #2f1f12; color: #fb923c; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--brand-soft); color: var(--brand-ink); }

/* ===== forms ===== */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: .86rem; font-weight: 600; color: var(--text-2); }
.field small, .hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, select.input {
  width: 100%; font: inherit; font-size: .94rem; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.field textarea { resize: vertical; min-height: 76px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .92rem; color: var(--text); user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ===== hero / lookup ===== */
.hero { position: relative; overflow: hidden; padding: 64px 0 40px; }
.hero-center { text-align: center; max-width: 820px; margin: 0 auto; }
.pill-tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .84rem; color: var(--text-2); box-shadow: var(--shadow-sm); }
.pill-tag b { white-space: nowrap; background: var(--grad); color: var(--on-brand); border-radius: 999px; padding: 1px 9px; font-size: .74rem; }
.ip-card { margin: 26px auto 0; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 28px 28px 22px; position: relative; }
.ip-label { font-size: .84rem; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ip-big { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.ip-big .mono { font-size: clamp(1.7rem, 6vw, 3rem); font-weight: 750; letter-spacing: -.02em; word-break: break-all; }
.ip-meta { color: var(--text-2); display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: .95rem; min-height: 1.6em; }
.ip-meta span { display: inline-flex; align-items: center; gap: 6px; }
.stack-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.stack-pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); font-size: .88rem; max-width: 100%; overflow-wrap: anywhere; }
.stack-pill b { color: var(--brand); font-size: .78rem; }
.search { display: flex; gap: 8px; margin: 26px auto 0; max-width: 760px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.search input { flex: 1; border: 0; background: none; font: inherit; font-size: 1rem; padding: 10px 12px; color: var(--text); min-width: 0; outline: none; }
.search select { border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: .9rem; border-radius: 10px; padding: 0 10px; cursor: pointer; }
.examples { margin-top: 12px; font-size: .86rem; color: var(--muted); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.examples button { border: 1px dashed var(--line); background: none; color: var(--text-2); border-radius: 999px; padding: 2px 10px; cursor: pointer; font: inherit; font-size: .82rem; }
.examples button:hover { border-color: var(--brand); color: var(--brand); }

.result { max-width: 1000px; margin: 28px auto 0; }
.result.loading { opacity: .55; transition: opacity .2s; }
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.result-ip { font-size: 1.5rem; font-weight: 750; margin: 0; word-break: break-all; }
.result-sub { margin: 4px 0 0; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cc { display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--grad); color: var(--on-brand); font-size: .7rem; font-weight: 750; letter-spacing: .04em; }
.result-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; margin-top: 20px; }
.result-body.no-map { grid-template-columns: 1fr; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.result-body.no-map .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv > div { padding: 11px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.kv dt { color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: 2px; }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.map { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); min-height: 260px; background: var(--surface-2); position: relative; align-self: start; position: sticky; top: 84px; }
.map iframe { width: 100%; height: 360px; border: 0; display: block; }
.map-note { position: absolute; left: 10px; bottom: 10px; background: color-mix(in srgb, var(--surface) 90%, transparent); font-size: .75rem; padding: 3px 9px; border-radius: 6px; color: var(--text-2); }
details.raw { margin-top: 18px; }
details.raw summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.source { margin-top: 12px; }
.source-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }

/* ===== code / terminal ===== */
.terminal { background: var(--code-bg); color: var(--code-text); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.06); }
.terminal-bar { display: flex; gap: 7px; padding: 12px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.06); align-items: center; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 8px; font-size: .78rem; color: #8b90b3; }
.terminal pre { padding: 18px 20px; font-size: .85rem; line-height: 1.7; overflow-x: auto; }
.terminal .p { color: #8b90b3; user-select: none; }
.terminal .c { color: #a5b4fc; }
.terminal .o { color: #9ae6b4; }
pre.code { background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: 12px; overflow: auto; font-size: .82rem; line-height: 1.6; max-height: 420px; }
.copyable { position: relative; cursor: pointer; }
.cmd { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; cursor: pointer; overflow-x: auto; white-space: nowrap; color: var(--text); }
.cmd::before { content: "$"; color: var(--muted); user-select: none; }
.cmd:hover { border-color: var(--brand); }
.copied::after { content: attr(data-copied-label); position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font: 600 12px/1 sans-serif; padding: 6px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 5; }
.cmd.copied, .copyable.copied { position: relative; overflow: visible; }

/* ===== sections ===== */
.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head p { color: var(--text-2); font-size: 1.02rem; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; display: block; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: .9rem; margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.list-check { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.list-check li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.list-check li::before { content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e9f6e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat; }
.cta { background: var(--dark-card); border-radius: 16px; padding: 44px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.cta h2 { color: #fff; font-size: 1.6rem; margin-bottom: 6px; }
.cta p { margin: 0; opacity: .88; }
.cta .btn { background: #fff; color: var(--brand-ink); border: 0; }
.page-head { padding: 52px 0 28px; text-align: center; position: relative; }
.page-head p { color: var(--text-2); max-width: 640px; margin: 0 auto; font-size: 1.02rem; }

/* ===== pricing ===== */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; position: relative; box-shadow: var(--shadow); }
.plan.hl { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.plan-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); color: var(--on-brand); font-size: .75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.plan h3 { font-size: 1.15rem; margin-bottom: 4px; }
.plan-desc { color: var(--text-2); font-size: .9rem; min-height: 2.8em; }
.price { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan ul { flex: 1; margin: 18px 0 24px; align-content: start; }
.plan .btn { width: 100%; }

/* ===== downloads ===== */
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.db { display: flex; flex-direction: column; }
.db-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-title h3 { margin: 0; }
.db-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 16px 0; font-size: .88rem; }
.db-meta dt { color: var(--muted); font-size: .78rem; font-weight: 600; }
.db-meta dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.db-meta .full { grid-column: 1 / -1; }
.hash { font-size: .74rem; color: var(--text-2); }
.db-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; }
.lock { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; }

/* ===== auth ===== */
.auth { display: grid; place-items: center; padding: 56px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 32px; }
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-sub { text-align: center; color: var(--text-2); margin-bottom: 24px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--text-2); font-size: .92rem; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }

/* ===== dashboard layout (account + admin) ===== */
.dash { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; padding: 32px 0 60px; align-items: start; }
.side { position: sticky; top: 88px; display: grid; gap: 2px; }
.side-title { font-size: .74rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; padding: 14px 12px 6px; }
.side a, .side button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: .93rem; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; width: 100%; }
.side a:hover, .side button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side .on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); border: 1px solid var(--line); }
.side svg { flex-shrink: 0; opacity: .85; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-head h1 { font-size: 1.6rem; margin: 0; }
.dash-head p { margin: 4px 0 0; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; }
.stat-sub { font-size: .8rem; color: var(--text-2); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; background: var(--grad); border-radius: 5px 5px 2px 2px; min-height: 3px; opacity: .85; position: relative; }
.bars div:hover { opacity: 1; }
.bars div span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--text-2); }
.bars-x { display: flex; gap: 6px; font-size: .7rem; color: var(--muted); margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; }
.plan-card { background: var(--dark-card); color: #fff; border: 0; position: relative; overflow: hidden; }
.plan-card::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); right: -80px; top: -120px; }
.plan-card .muted, .plan-card .text-2 { color: rgba(255,255,255,.78); }
.plan-card h2 { color: #fff; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s; }
.plan-card .progress { background: rgba(255,255,255,.22); }
.plan-card .progress > i { background: #fff; }
.key-box { display: flex; gap: 8px; align-items: center; }
.key-box code { flex: 1; padding: 10px 12px; border-radius: 10px; font-size: .86rem; overflow-x: auto; white-space: nowrap; display: block; }

/* ===== tables ===== */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 650; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.user-cell b { display: block; font-weight: 600; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { width: auto; flex: 1; min-width: 180px; }
.toolbar select.input { flex: 0 0 auto; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: .86rem; color: var(--text-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.setting-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > div:first-child b { display: block; font-weight: 650; font-size: .94rem; }
.setting-row > div:first-child span { color: var(--muted); font-size: .84rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.checklist .n { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.diag { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; font-size: .88rem; }
.diag dt { color: var(--muted); }
.diag dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* ===== modal / toast ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 12, 24, .5); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; padding: 26px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.sm { max-width: 440px; }
.modal h2 { margin-bottom: 18px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .25s ease; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ===== footer ===== */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 28px; margin-top: 40px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--text-2); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line-2); margin-top: 28px; padding-top: 20px; color: var(--muted); font-size: .84rem; }
.footer-bottom a { color: var(--muted); }

/* ===== docs ===== */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding: 40px 0 60px; }
.docs-nav { position: sticky; top: 88px; align-self: start; display: grid; gap: 2px; }
.docs-nav a { color: var(--text-2); padding: 6px 12px; border-radius: 8px; font-size: .92rem; }
.docs-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.docs article { min-width: 0; }
.docs article h2 { margin-top: 40px; padding-top: 8px; scroll-margin-top: 80px; }
.docs article h2:first-child { margin-top: 0; }
.docs article h3 { margin-top: 24px; }
.docs article p, .docs article li { color: var(--text-2); }
.endpoint { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.method { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); font-family: ui-monospace, monospace; }
.docs .table td code { white-space: nowrap; }

/* ===== responsive ===== */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; }
  .side { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side-title { display: none; }
  .side a, .side button { width: auto; white-space: nowrap; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { display: none; }
  .result-body { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .code-gen { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 720px) {
  .toolbar .input { min-width: 0; flex-basis: 140px; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-direction: column; padding: 10px 16px 16px; box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-grid; }
  .nav-in { gap: 12px; }
  .menu-btn .name { display: none; }
  .lang-btn .lang-name, .lang-btn .lang-caret { display: none; }
  .lang-btn { padding: 0; width: 36px; justify-content: center; border-color: transparent; background: none; }
  .hero { padding: 36px 0 24px; }
  .ip-card { padding: 22px 16px 18px; border-radius: 16px; }
  .search input { padding: 10px 6px; font-size: .95rem; }
  .search .btn { padding: 9px 14px; }
  .kv, .result-body.no-map .kv { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .cta { padding: 28px; }
  .section { padding: 44px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .diag { grid-template-columns: 1fr; gap: 2px; }
  .diag dd { margin-bottom: 8px; }
  .nav-right .btn.ghost { display: none; }
}
@media (max-width: 400px) {
  .nav-in { gap: 8px; }
  .nav-right { gap: 2px; }
  .nav-right .btn { padding: 7px 10px; font-size: .82rem; }
  .logo { font-size: .98rem; gap: 8px; }
  .logo-mark { width: 28px; height: 28px; }
  .icon-btn, .lang-btn { width: 32px; height: 32px; }
}

.prefix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; font-size: .88rem; }
.prefix-grid a { color: var(--text); padding: 3px 0; border-bottom: 1px dashed var(--line-2); overflow-wrap: anywhere; }
.prefix-grid a:hover { color: var(--brand); text-decoration: none; }
.chip { border: 1px dashed var(--line); color: var(--text-2); border-radius: 999px; padding: 2px 10px; font-size: .82rem; }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.source-card { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

/* editions */
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 16px; }
.ed { position: relative; display: flex; flex-direction: column; gap: 6px; }
.ed.hl { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.ed-head { display: flex; align-items: center; gap: 8px; }
.ed-head h3 { margin: 0; }
.ed-count { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.ed-desc { flex: 1; margin: 0; }
.ed-fmt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.section-title { margin: 36px 0 14px; font-size: 1.25rem; }
.table.cmp th.c, .table.cmp td.c { text-align: center; white-space: nowrap; }
.table.cmp th.hl { color: var(--brand); }
.table.cmp tr.grp td { background: var(--bg); font-weight: 650; font-size: .82rem; color: var(--text-2); }
.table.cmp code { font-size: .75rem; margin-left: 4px; }
.table.cmp .yes { color: var(--ok, #16a34a); font-weight: 700; }
.table.cmp .no { color: var(--muted); }
.ed-files { display: grid; gap: 8px; margin-top: 14px; }
.ed-file { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ed-file .mono { overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips span { font-size: .75rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--text-2); }
@media (max-width: 640px) { .ed-file { grid-template-columns: 1fr 1fr; } .ed-file .actions { grid-column: 1 / -1; } }

/* admin sidebar */
.nav-panel { gap: 0; padding: 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); max-height: calc(100vh - 110px); overflow-y: auto; }
.aside-head { display: flex; align-items: center; gap: 10px; padding: 2px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.aside-head b { display: block; font-size: .95rem; line-height: 1.2; }
.aside-head small { display: block; color: var(--muted); font-size: .74rem; margin-top: 2px; }
.aside-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--on-brand); background: var(--brand); }
.aside-logo svg { width: 18px; height: 18px; opacity: 1; }
.nav-group { display: grid; gap: 2px; padding: 4px 0; }
.nav-group + .nav-group { border-top: 1px dashed var(--line); }
.nav-panel .side-title { padding: 8px 10px 4px; font-size: .7rem; letter-spacing: .12em; }
.nav-panel :is(button, a:not(.aside-foot)) { position: relative; gap: 12px; padding: 5px 10px; min-height: 38px; border: 1px solid transparent; font-size: .92rem; transition: background .15s, color .15s; }
.nav-panel :is(button, a:not(.aside-foot)):hover { background: var(--surface-2); }
.nav-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; transition: background .15s, color .15s; }
.nav-ic svg { width: 17px; height: 17px; }
.nav-label { flex: 1; }
.nav-badge { font-size: .7rem; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--brand); color: var(--on-brand); }
.nav-panel :is(button, a:not(.aside-foot)).on { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; border-color: transparent; }
.nav-panel :is(button, a:not(.aside-foot)).on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-panel :is(button, a:not(.aside-foot)).on .nav-ic { background: var(--brand); color: var(--on-brand); }
.aside-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px 12px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; text-decoration: none; }
.aside-foot:hover { color: var(--brand); text-decoration: none; }
@media (max-width: 960px) {
  .nav-panel { display: flex; min-width: 0; flex: 1 1 auto; padding: 6px; border-radius: 14px; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav-panel::-webkit-scrollbar { display: none; }
  .aside-head, .aside-foot { display: none; }
  .nav-group { display: flex; gap: 4px; padding: 0; }
  .nav-group + .nav-group { border-top: 0; border-left: 1px dashed var(--line); margin-left: 4px; padding-left: 4px; }
  .nav-panel :is(button, a:not(.aside-foot)) { min-height: 38px; padding: 5px 10px 5px 6px; gap: 8px; }
  .nav-panel :is(button, a:not(.aside-foot)).on::before { display: none; }
  .nav-ic { width: 26px; height: 26px; }
}

/* settings tabs */
.stabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 5px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.stabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text-2); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.stabs button svg { width: 16px; height: 16px; opacity: .8; }
.stabs button:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.stabs button.on { background: var(--surface); color: var(--brand); border-color: var(--line); box-shadow: var(--shadow); }
.stabs button.on svg { opacity: 1; }
.settings-card { padding-top: 22px; }
.settings-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.settings-head h2 { margin: 0; font-size: 1.15rem; }
.settings-head p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.settings-head .nav-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.settings-head .nav-ic svg { width: 19px; height: 19px; }
.settings-card .setting-row { grid-template-columns: 220px minmax(0, 1fr); padding: 20px 0; }
.save-bar { position: relative; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px 10px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.save-bar.dirty { position: sticky; bottom: 16px; border-color: var(--brand); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--brand) 45%, transparent); }
.save-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.save-state .dot { color: var(--ok); }
.save-bar.dirty .save-state { color: var(--text); font-weight: 600; }
.save-bar.dirty .save-state .dot { color: var(--warn, #d97706); }
@media (max-width: 1180px) {
  .stabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stabs button { padding: 8px 12px; }
}
@media (max-width: 720px) {
  .stabs::-webkit-scrollbar { display: none; }
  .settings-card .setting-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .save-bar.dirty { bottom: 10px; }
}

/* plugin picker */
.plugin-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 18px; }
.plugin-picker button { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.plugin-picker button:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.plugin-picker button.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset, var(--shadow); }
.plugin-picker .nav-ic { width: 36px; height: 36px; border-radius: 10px; }
.plugin-picker button.on .nav-ic { background: var(--brand); color: var(--on-brand); }
.pp-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.pp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-sub { color: var(--text-2); font-size: .86rem; }
.pp-meta { color: var(--muted); font-size: .8rem; }

/* segmented control (small in-page tabs and filters) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--text-2); font: inherit; font-size: .87rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--brand); border-color: var(--line); box-shadow: var(--shadow); }
.seg .n { font-weight: 500; color: var(--muted); font-size: .8rem; }
.seg button.on .n { color: inherit; opacity: .75; }
.seg .set-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.seg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
}
.nav-panel > :is(button, a:not(.aside-foot)) { margin: 1px 0; }
.nav-panel > .side-title:first-child { padding-top: 4px; }

.extra-src { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.extra-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }

.price-was { margin: -6px 0 6px; color: var(--muted); font-size: .9rem; }
.form-sec { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; display: grid; gap: 12px; margin: 0; }
.form-sec > legend { padding: 0 6px; font-weight: 650; font-size: .92rem; }
.dur-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.dur-picks button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .85rem; cursor: pointer; }
.dur-picks button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.price-tabs { display: grid; justify-items: center; gap: 10px; margin: 0 0 26px; text-align: center; }
.price-tabs .seg button { padding: 8px 18px; font-size: .95rem; }
.price-tabs p { margin: 0; }

.progress.light { background: rgba(255,255,255,.22); }
.progress.light i { background: #fff; }
.small-bars { height: 90px; }

/* tools */
.install-card .cmd { font-size: .95rem; cursor: pointer; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 20px; }
.tool-grid > .card { margin-top: 0; }
.tool .cmd { margin-top: 8px; }
.tool-head { display: flex; align-items: center; gap: 10px; }
.tool-head h3, .tool-head h2 { margin: 0; }
.tool-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.terminal .t-asn { color: #67e8f9; }
.terminal .t-loc { color: #86efac; }
.cli-code { margin: 18px 0 10px; text-align: center; font: 700 2rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: var(--brand); }
.setting-row > input, .setting-row > select { align-self: start; }

/* tools menu */
.nav-drop { position: relative; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 4px; }
.nav-drop-btn svg { opacity: .6; transition: transform .15s; }
.nav-sub { display: none; position: absolute; left: -8px; top: 100%; padding-top: 8px; z-index: 30; }
.nav-sub::before { content: ""; position: absolute; inset: 8px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: -1; }
.nav-drop:hover .nav-sub, .nav-drop:focus-within .nav-sub { display: grid; min-width: 280px; padding: 14px 6px 6px; }
.nav-drop:hover .nav-drop-btn svg { transform: rotate(180deg); }
.nav-sub a { display: grid; gap: 2px; padding: 9px 12px; border-radius: 8px; }
.nav-sub a b { color: var(--text); font-weight: 600; font-size: .93rem; }
.nav-sub a span { color: var(--muted); font-size: .8rem; font-weight: 400; line-height: 1.4; }
.nav-sub a.nav-sub-all { color: var(--brand); font-size: .85rem; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.tool-link { display: flex; flex-direction: column; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tool-link:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool-more { margin-top: auto; padding-top: 14px; color: var(--brand); font-size: .88rem; font-weight: 600; }
.prose { line-height: 1.75; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose img { max-width: 100%; }
.page-head .eyebrow a { color: inherit; }
@media (max-width: 720px) {
  .nav-drop .nav-sub { display: grid; position: static; padding: 0 0 0 12px; min-width: 0; }
  .nav-sub::before { display: none; }
  .nav-sub a span, .nav-drop-btn svg { display: none; }
  .nav-sub a b { font-weight: 500; color: var(--text-2); }
}

/* ===== header search ===== */
.nav-search { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 1 280px; min-width: 150px; height: 38px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; color: var(--muted); transition: border-color .15s, background .15s; }
.nav-search:focus-within { border-color: var(--line); background: var(--surface); }
.nav-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: .9rem; }
.nav-search input::-webkit-search-cancel-button { display: none; }
.nav-search + .nav-right { margin-left: 12px; }
.nav-links a, .nav-drop-btn { white-space: nowrap; }
@media (max-width: 1320px) { .lang-name, .lang-caret { display: none; } .nav-in { gap: 18px; } .nav-links a { padding: 7px 10px; } }
/* below 1100px the links collapse into the menu button, the search stays in the bar */
@media (max-width: 1100px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-direction: column; padding: 10px 16px 16px; box-shadow: var(--shadow-lg); z-index: 40; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-grid; }
  .nav-drop .nav-sub { display: grid; position: static; padding: 0 0 0 12px; min-width: 0; }
  .nav-sub::before { display: none; }
  .nav-sub a span, .nav-drop-btn svg { display: none; }
  .nav-sub a b { font-weight: 500; color: var(--text-2); }
}
@media (max-width: 720px) {
  .nav-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .nav-search { order: 10; flex: 1 1 100%; margin: 0; }
  .nav-search + .nav-right { margin-left: auto; }
  .nav-links { top: 100%; }
}

/* ===== home: IPv4 / IPv6 cards (ip.sb style) ===== */
.home { padding: 40px 0 56px; }
.home-col { max-width: 880px; display: grid; gap: 22px; }
.ipc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ipc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.ipc-head h2 { margin: 0; font-size: 1.12rem; font-weight: 700; overflow-wrap: anywhere; }
.ipc-status { font-size: .9rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.ipc-status.ok { color: var(--ok); }
.ipc-status.no { color: var(--danger); }
.ipc-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 32px; align-items: center; min-height: 48px; padding: 0 12px 0 24px; border-bottom: 1px solid var(--line-2); }
.ipc-row:last-child { border-bottom: 0; }
.ipc-k { color: var(--muted); font-size: .9rem; }
.ipc-v { font-size: .94rem; overflow-wrap: anywhere; padding: 10px 0; }
.ipc-v a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ipc-v a:hover { text-decoration-color: currentColor; }
.ipc-v .mono { font-size: .9rem; }
.ipc-copy { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.ipc-row:hover .ipc-copy, .ipc-copy:focus-visible { opacity: 1; }
.ipc-copy:hover { background: var(--surface-2); color: var(--text); }
.ipc-more { border-top: 1px solid var(--line-2); }
.ipc-more .ipc-row { background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.ipc-map { margin: 14px 24px 18px; position: relative; top: auto; min-height: 0; }
.ipc-map iframe { height: 300px; }
.ipc-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 12px; border: 0; border-top: 1px solid var(--line-2);
  background: none; color: var(--text-2); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.ipc-toggle:hover { color: var(--text); background: var(--surface-2); }
.ipc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.ipc-msg { margin: 0; padding: 18px 24px; color: var(--muted); }
.ipc-msg.error { color: var(--danger); }
.home details.raw { margin: 0; padding: 14px 20px; }
.home .cc { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
@media (max-width: 640px) {
  .home { padding: 20px 0 40px; }
  .ipc-head { padding: 14px 16px; }
  .ipc-row { grid-template-columns: minmax(0, 1fr) 32px; padding: 8px 8px 8px 16px; }
  .ipc-k { grid-column: 1; font-size: .82rem; }
  .ipc-v { grid-column: 1; padding: 2px 0 0; }
  .ipc-copy { grid-column: 2; grid-row: 1 / 3; opacity: 1; }
  .ipc-map { margin: 12px 16px 16px; }
}

/* ===== promotion cards ===== */
.promo { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: border-color .15s; }
.promo:hover { text-decoration: none; border-color: color-mix(in srgb, var(--text) 30%, var(--line)); }
.promo-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.promo-brand b { display: block; font-size: 1rem; letter-spacing: .02em; }
.promo-brand small { display: block; color: var(--muted); font-size: .8rem; }
.promo-mono { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); border: 1px solid transparent; color: var(--brand); font-weight: 700; font-size: 1.05rem; }
.promo-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; object-fit: contain; }
.promo-main { display: grid; gap: 6px; min-width: 0; }
.promo-main > b { font-size: .95rem; font-weight: 600; }
.promo-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 18px; font-size: .8rem; color: var(--muted); }
.promo-points span { position: relative; padding-left: 13px; }
.promo-points span::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; }
.promo-points span:nth-child(2)::before { background: #8b5cf6; }
.promo-points span:nth-child(3)::before { background: #10b981; }
.promo-points span:nth-child(4)::before { background: #f59e0b; }
.promo-points b { color: var(--text-2); font-weight: 600; }
.promo-buy { display: grid; justify-items: end; gap: 8px; text-align: right; }
.promo-price { white-space: nowrap; }
.promo-price b { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin: 0 2px; }
.promo-price small { color: var(--text-2); font-size: .82rem; }
.promo-btn { display: inline-block; padding: 6px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.promo:hover .promo-btn { background: var(--brand); color: var(--on-brand); }
@media (max-width: 860px) {
  .promo { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 18px; gap: 14px; }
  .promo-main { display: none; }
  .promo-price { display: none; }
}

/* ===== refinements ===== */
.nav { border-bottom-color: var(--line-2); }
.lang-name, .lang-caret { display: none; }
.lang-btn { width: 36px; padding: 0; justify-content: center; }
.nav-search { flex-basis: 320px; }
.ipc { box-shadow: var(--shadow); }
.ipc-head h2 { font-size: 1.05rem; font-weight: 600; }
.ipc-k { color: var(--muted); }
.promo { box-shadow: var(--shadow); }
.promo:hover .promo-btn { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.promo:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card { border-color: var(--line); }
.menu-btn, .menu-btn .name { white-space: nowrap; }

/* admin: data sources */
.src-card.src-primary { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent) inset; }
.src-order { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; }
.src-primary .src-order { background: var(--brand); color: var(--on-brand); }
.src-files { display: grid; gap: 8px; margin-bottom: 12px; }
.src-file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.src-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 0 0 14px; }
.src-meta dt { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.src-meta dd { margin: 0; font-size: .9rem; }
.src-card .card-head > .row { flex-wrap: wrap; min-width: 0; }
.src-file > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .src-card .card-head { align-items: flex-start; }
  .src-meta { grid-template-columns: minmax(0, 1fr); }
}
.stack > * { min-width: 0; }
div[x-show="tab==='sources'"] td.mono { overflow-wrap: anywhere; }

/* docs */
.docs-switch { display: inline-flex; gap: 3px; padding: 4px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.docs-switch a { padding: 6px 14px; border-radius: 9px; color: var(--text-2); font-size: .9rem; font-weight: 600; white-space: nowrap; }
.docs-switch a:hover { color: var(--text); text-decoration: none; }
.docs-switch a.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.dd-fields td { vertical-align: top; }
.dd-fields td:first-child { white-space: nowrap; }
.dd-fields tr:target { background: var(--brand-soft); }
.dd-fields td:nth-child(2) { min-width: 220px; }
.dd-ex { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.dd-ex code { font-size: .78rem; }
.docs .table td code.dd-path { white-space: normal; overflow-wrap: normal; word-break: keep-all; }
.dd-in { min-width: 150px; }
.dd-in .badge { margin: 0 4px 4px 0; }
@media (min-width: 1100px) {
  .plans:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
  .plans:has(> :nth-child(5):last-child) .plan-desc { min-height: 9.6em; }
}
