:root {
  --primary: #1d4ed8;
  --primary-dark: #1638a8;
  --accent: #3b82f6;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 24px -18px rgba(15, 23, 42, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0b1220;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header .inner {
  max-width: var(--maxw, 1180px);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.brand-text { color: #fff; font-weight: 600; letter-spacing: 0.2px; }
.brand-text small { display: block; font-weight: 400; font-size: 11px; color: #94a3b8; letter-spacing: 0.4px; }

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }

.site-nav a {
  color: #cbd5e1;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.site-nav a.active { color: #fff; background: rgba(59, 130, 246, 0.25); }

.hero {
  background: linear-gradient(135deg, #1638a8 0%, #1d4ed8 45%, #3b82f6 100%);
  color: #fff;
}

.hero-inner {
  max-width: var(--maxw, 1180px);
  margin: 0 auto;
  padding: 44px 20px;
}

.hero h1 { margin: 0 0 10px; font-size: 2.15rem; letter-spacing: -0.02em; }
.hero p { margin: 0; max-width: 62ch; color: #dbeafe; font-size: 1.02rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
}

.layout {
  max-width: var(--maxw, 1180px);
  margin: 0 auto;
  padding: 30px 20px 64px;
  display: grid;
  grid-template-columns: 262px 1fr;
  gap: 28px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 78px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.toc h2 { margin: 0 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.toc a {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.6px;
  text-decoration: none;
}

.toc a:hover { background: #eff6ff; color: var(--primary); text-decoration: none; }

.article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 36px;
  box-shadow: var(--shadow);
}

.article h2 {
  margin: 30px 0 12px;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.article h2:first-child { margin-top: 0; }
.article h3 { margin: 20px 0 8px; font-size: 1.03rem; }
.article p { margin: 10px 0; }
.article ul, .article ol { padding-left: 22px; margin: 10px 0; }
.article li { margin: 6px 0; }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }

.meta {
  font-size: 12.5px;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
}

.callout {
  border-left: 4px solid var(--accent);
  background: #eff6ff;
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 18px 0;
}

.callout.warn { border-color: #f59e0b; background: #fffbeb; }
.callout.stop { border-color: #ef4444; background: #fef2f2; }
.callout.ok { border-color: #22c55e; background: #f0fdf4; }
.callout p { margin: 6px 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.app-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.app-card b { display: block; font-size: 14.5px; }
.app-card span { font-size: 12.5px; color: var(--muted); }
.app-card code { font-size: 11.5px; }

.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }

table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 520px; }

th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }

th { background: #f8fafc; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fcfdfe; }

code, .mono {
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 13px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 16px 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 46px;
  border-left: 2px solid var(--line);
  margin-left: 15px;
}

.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.steps b { display: block; margin-bottom: 2px; }

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: #f8fafc;
  margin: 18px 0;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

label { font-size: 13.5px; font-weight: 600; color: #334155; }
label .req { color: #dc2626; }

input, select, textarea {
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

textarea { resize: vertical; min-height: 96px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: 0 0 auto; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: 11px;
  padding: 11px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--primary); border-color: #cbd5e1; }
.btn-ghost:hover { background: #eff6ff; text-decoration: none; }

.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  background: #fff;
}

.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

.note { font-size: 13.5px; color: var(--muted); }

.site-footer { background: #0b1220; color: #94a3b8; padding: 40px 20px; }

.site-footer .inner { max-width: var(--maxw, 1180px); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }

.site-footer h3 { color: #fff; font-size: 0.95rem; margin: 0 0 10px; }
.site-footer a { color: #cbd5e1; display: block; padding: 3px 0; font-size: 14px; }
.site-footer p { margin: 8px 0 0; font-size: 13.5px; }
.site-footer .copy { max-width: var(--maxw, 1180px); margin: 28px auto 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 12.5px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .article { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .site-footer .inner { grid-template-columns: 1fr; gap: 22px; }
}

@media print {
  .site-header, .site-footer, .toc, .form-card, .btn-row { display: none !important; }
  .layout { grid-template-columns: 1fr; padding: 0; }
  .article { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
}
