/* Cirrus AI docs — Car Tracker Installation Guide */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6fb;
  --bg-soft-2: #eef0f8;
  --ink: #0e1330;
  --ink-2: #2a3056;
  --ink-3: #525a82;
  --ink-mute: #8a90b1;
  --line: #e4e6f1;
  --line-strong: #c9ccdd;
  --accent: #2b53ff;
  --accent-press: #1f3fd6;
  --accent-soft: #e7ecff;
  --warn: #b5530a;
  --warn-soft: #fff4e4;
  --good: #0f7a4a;
  --good-soft: #e6f6ee;
  --bad: #a92141;
  --bad-soft: #fce6ec;
  --code-bg: #0e1330;
  --code-ink: #e6e8f5;
  --code-mute: #8a90b1;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14, 19, 48, 0.05);
  --shadow-md: 0 12px 32px -16px rgba(14, 19, 48, 0.18);
  --max: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ===== NAV ===== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.topnav-links { display: flex; gap: 28px; align-items: center; margin-left: 8px; }
.topnav-links a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.topnav-links a:hover { color: var(--accent); }
.topnav-spacer { flex: 1; }
.crumb {
  color: var(--ink-3); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.crumb .sep { color: var(--line-strong); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--accent); color: #fff;
  border-radius: 999px; border: none;
  font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-press); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--ink-3); }

/* ===== HERO ===== */
.hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfbfe 0%, #ffffff 100%);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 32px 56px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: end;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: var(--accent-soft);
  border-radius: 999px;
  margin-bottom: 24px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lede {
  font-size: 19px;
  color: var(--ink-2);
  max-width: 620px;
  line-height: 1.55;
  margin: 0 0 32px;
}
.hero-meta { display: flex; gap: 28px; flex-wrap: wrap; color: var(--ink-3); font-size: 14px; }
.hero-meta b { color: var(--ink); font-weight: 700; }

.hero-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.hero-card h2 {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.hero-toc { display: grid; gap: 4px; }
.hero-toc a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600; font-size: 15px;
  transition: background .15s, color .15s;
}
.hero-toc a:hover { background: var(--bg-soft); color: var(--ink); }
.hero-toc .num {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.hero-toc a:hover .num { background: var(--accent); color: #fff; }

/* ===== LAYOUT ===== */
.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}
.sidebar {
  position: sticky; top: 88px;
  padding: 48px 0 80px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}
.sidebar h2 {
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 12px;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar a {
  display: block;
  padding: 7px 12px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color .15s, border-color .15s, background .15s;
  border-radius: 0 6px 6px 0;
}
.sidebar a:hover { color: var(--ink); background: var(--bg-soft); }
.sidebar a.active {
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.sidebar a.sub { padding-left: 28px; font-size: 13px; }

.main { padding: 48px 0 120px; min-width: 0; }

/* ===== TYPOGRAPHY ===== */
.main h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.1;
}
.main section + section h2 { margin-top: 88px; }
.main h3 { font-size: 22px; font-weight: 700; margin: 40px 0 12px; letter-spacing: -0.01em; }
.main h4 { font-size: 17px; font-weight: 700; margin: 28px 0 8px; }
.main p { margin: 0 0 16px; color: var(--ink-2); font-size: 16px; }
.main p strong, .main li strong { color: var(--ink); font-weight: 700; }
.main ul, .main ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.main li { margin-bottom: 6px; }
.main a { color: var(--accent); text-decoration: none; font-weight: 600; }
.main a:hover { text-decoration: underline; }
.main a[href^="http"]::after { content: " ↗"; opacity: .65; font-size: .8em; }
.main .muted { color: var(--ink-3); font-size: 14px; }
.section-intro {
  font-size: 18px;
  color: var(--ink-3);
  max-width: 720px;
  line-height: 1.55;
  margin: 0 0 32px;
}
.anchor { scroll-margin-top: 100px; }

/* ===== STEP HEADER ===== */
.step-header { display: flex; align-items: baseline; gap: 18px; margin: 40px 0 8px; }
.step-num {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800;
  align-self: center;
}
.step-header h3 { margin: 0; }
.step-body { padding-left: 62px; }

/* ===== CALLOUTS ===== */
.callout {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  margin: 20px 0;
}
.callout .icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.callout p { font-size: 15px; }
.callout p:last-child { margin-bottom: 0; }
.callout-info { background: var(--accent-soft); border-color: #c8d2ff; }
.callout-info .icon { background: var(--accent); }
.callout-warn { background: var(--warn-soft); border-color: #f3d4a3; }
.callout-warn .icon { background: var(--warn); }
.callout-tip { background: var(--good-soft); border-color: #b9e5cc; }
.callout-tip .icon { background: var(--good); }
.callout-label {
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.callout-info .callout-label { color: var(--accent); }
.callout-warn .callout-label { color: var(--warn); }
.callout-tip .callout-label { color: var(--good); }

/* ===== CODE ===== */
.code-block {
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}
.code-block pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.code-block .copy {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--code-ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit; font-size: 11px;
  cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.code-block:hover .copy, .code-block .copy:focus-visible { opacity: 1; }
.code-block .copy:hover { background: rgba(255, 255, 255, 0.16); }
.code-block .copy.copied { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.code-block .lang {
  position: absolute;
  top: 10px; left: 16px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--code-mute);
}
.code-block.with-lang { padding-top: 36px; }
code.inline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
  border: 1px solid var(--line);
}

/* ===== TABLES ===== */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 20px 0;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 15px; }
thead th {
  text-align: left;
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tbody td, tbody th {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
  text-align: left;
}
tbody th { color: var(--ink); font-weight: 700; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
tbody td strong { color: var(--ink); }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tag-good { background: var(--good-soft); color: var(--good); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }

/* ===== CONTROLLER CARDS ===== */
.ctrl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.ctrl-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: #fff;
  position: relative;
}
.ctrl-card.supported { border-color: #b9e5cc; }
.ctrl-card.partial { border-color: #f3d4a3; }
.ctrl-card.unsupported { border-color: var(--line); background: var(--bg-soft); }
.ctrl-card h4 { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.ctrl-card .ctrl-power { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-bottom: 14px; }
.ctrl-card p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.ctrl-card .status { position: absolute; top: 18px; right: 18px; }

/* ===== FIGURES ===== */
.doc-figure { margin: 20px 0; }
.main li > .doc-figure, .main li > .figure-row { margin: 14px 0; }
.doc-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
}
.doc-figure.fig-pad img { background: #fff; padding: 8px; }
.doc-figure.fig-420 img { max-width: 420px; }
.doc-figure.fig-480 img { max-width: 480px; }
.doc-figure.fig-560 img { max-width: 560px; }
.doc-figure.fig-640 img { max-width: 640px; }
.figure-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0; }
.figure-row .doc-figure { margin: 0; flex: 1 1 300px; }
.image-caption {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin: 10px 0 24px;
  font-style: italic;
}
.doc-figure figcaption.image-caption { margin: 10px 0 0; }

/* ===== COLLAPSIBLE TROUBLESHOOTING ===== */
details.tshoot {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 10px 0;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s;
}
details.tshoot[open] { border-color: var(--accent); box-shadow: var(--shadow-sm); }
details.tshoot summary {
  cursor: pointer;
  padding: 16px 20px;
  list-style: none;
  display: flex; align-items: center; gap: 14px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  user-select: none;
}
details.tshoot summary::-webkit-details-marker { display: none; }
details.tshoot summary .chev {
  margin-left: auto;
  width: 22px; height: 22px;
  flex-shrink: 0;
  transition: transform .2s ease;
  color: var(--ink-3);
}
details.tshoot[open] summary .chev { transform: rotate(180deg); color: var(--accent); }
details.tshoot summary .badge {
  width: 26px; height: 26px;
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
details.tshoot .ts-body {
  padding: 18px 20px 20px 60px;
  border-top: 1px solid var(--line);
}
details.tshoot .ts-body p { font-size: 15px; }

/* ===== CHECKLIST ===== */
.check-list { list-style: none; padding: 0; margin: 16px 0 20px; }
.check-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.check-list li:last-child { border-bottom: none; }
.check-list .check-box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  cursor: pointer;
  margin-top: 2px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  transition: background .15s, border-color .15s;
}
.check-list .check-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-list .check-box.checked { background: var(--accent); border-color: var(--accent); }
.check-list .check-box.checked::after {
  content: ""; display: block;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(0, -1px);
}
.check-list .check-text { font-size: 15px; color: var(--ink-2); }
.check-list .check-box.checked + .check-text { color: var(--ink-mute); text-decoration: line-through; }

/* ===== FOOTER ===== */
footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 48px 32px; }
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 24px;
}
.footer-inner .muted { color: var(--ink-3); font-size: 14px; }
.footer-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== PROGRESS BAR ===== */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width .1s linear; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .ctrl-grid { grid-template-columns: 1fr; }
  .topnav-links, .crumb { display: none; }
}
@media (max-width: 640px) {
  .hero-inner { padding: 48px 24px 40px; }
  .topnav-inner { padding: 14px 20px; gap: 16px; }
  .layout { padding: 0 20px; }
  .step-body { padding-left: 0; }
  .step-header { gap: 12px; }
  details.tshoot .ts-body { padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-bar, .btn, details.tshoot summary .chev { transition: none; }
}
@media print {
  .topnav, .progress, .sidebar, footer .footer-actions, .code-block .copy { display: none !important; }
  .layout { display: block; }
  details.tshoot { break-inside: avoid; }
  details.tshoot .ts-body { display: block; }
}
