:root {
  color-scheme: light dark;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --hairline: #d2d2d7;
  --hairline-light: #e8e8ed;
  --surface: #ffffff;
  --fill: #f5f5f7;
  --fill-hover: #e8e8ed;
  --tint: #00777d;
  --tint-hover: #005f64;
  --tint-soft: #e4f2f2;
  --success: #2d7d46;
  --warning: #b25000;
  --danger: #9b3b24;
  --danger-soft: #fdf1ee;
  --cab: #bd5d32;
  --sensor: #247b80;
  --tag: #8b6a31;
  --topbar-height: 48px;
  --sidebar-width: 250px;
  --rail-width: 180px;
  --content-max: 740px;
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 18px;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --hairline: #424245;
    --hairline-light: #2c2c2e;
    --surface: #000000;
    --fill: #161617;
    --fill-hover: #232324;
    --tint: #4cc2cb;
    --tint-hover: #74d5dc;
    --tint-soft: #0d2f31;
    --success: #4fbf74;
    --warning: #e58a3a;
    --danger: #e0765a;
    --danger-soft: #2c1712;
    --cab: #d97e52;
    --sensor: #4ba6ab;
    --tag: #bd975a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--tint);
  text-decoration: none;
}

a:hover {
  color: var(--tint-hover);
  text-decoration: underline;
}

button {
  color: inherit;
}

svg {
  display: block;
}

code,
kbd {
  font-family: var(--font-mono);
}

code {
  font-size: 0.82em;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 40%, transparent);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-small);
  color: var(--surface);
  background: var(--text);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Brand */

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand-sub {
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--hairline);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--text);
  overflow: hidden;
}

.brand-mark span {
  position: absolute;
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--surface);
  transform: rotate(-52deg);
}

.brand-mark span:nth-child(1) {
  left: 4px;
  width: 10px;
}

.brand-mark span:nth-child(2) {
  left: 8px;
  width: 14px;
  transform: rotate(62deg);
}

.brand-mark span:nth-child(3) {
  right: 2px;
  width: 9px;
}

.brand-mark--large {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.brand-mark--large span {
  height: 3px;
}

.brand-mark--large span:nth-child(1) {
  left: 7px;
  width: 17px;
}

.brand-mark--large span:nth-child(2) {
  left: 14px;
  width: 23px;
}

.brand-mark--large span:nth-child(3) {
  right: 4px;
  width: 15px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-medium);
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
}

.button--primary {
  color: #ffffff;
  background: var(--tint);
}

.button--primary:hover {
  color: #ffffff;
  background: var(--tint-hover);
  text-decoration: none;
}

.button--wide {
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .button--primary {
    color: #04292b;
  }

  .button--primary:hover {
    color: #04292b;
  }
}

/* Authentication */

.auth-page {
  min-height: 100vh;
  background: var(--surface);
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.auth-panel {
  width: min(360px, 100%);
  padding-bottom: 8vh;
  text-align: center;
}

.auth-panel .brand-mark {
  margin: 0 auto 26px;
}

.auth-panel h1 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-lede {
  margin: 0 0 30px;
  color: var(--text-secondary);
  font-size: 15px;
}

.auth-error {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: var(--radius-medium);
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 14px;
  text-align: left;
}

.auth-error:empty {
  display: none;
}

.auth-form {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.input-group {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-medium);
  background: var(--surface);
  overflow: hidden;
}

.input-group input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
}

.input-group input::placeholder {
  color: var(--text-tertiary);
}

.input-group input + input {
  border-top: 1px solid var(--hairline);
}

.input-group:focus-within {
  border-color: var(--tint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 18%, transparent);
}

.auth-form .button {
  margin-top: 18px;
}

.auth-hint {
  margin: 26px 0 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Element grabber */

.element-grab-active,
.element-grab-active * {
  cursor: crosshair !important;
}

.element-grab-outline {
  position: fixed;
  z-index: 1000;
  top: var(--grab-top, 0);
  left: var(--grab-left, 0);
  display: none;
  width: var(--grab-width, 0);
  height: var(--grab-height, 0);
  border: 2px solid var(--tint);
  border-radius: 4px;
  background: color-mix(in srgb, var(--tint) 8%, transparent);
  pointer-events: none;
}

.element-grab-outline[data-visible] {
  display: block;
}

.element-grab-toast {
  position: fixed;
  z-index: 1001;
  bottom: 24px;
  left: 50%;
  padding: 10px 15px;
  border-radius: 9px;
  color: var(--surface);
  background: var(--text);
  box-shadow: 0 6px 20px rgb(0 0 0 / 14%);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.element-grab-toast[data-error] {
  background: var(--danger);
}

.element-grab-toast[data-visible] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Shell */

.docs-page {
  min-height: 100vh;
  background: var(--surface);
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline-light);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.user-area {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  margin-left: auto;
}

.user-copy {
  color: var(--text-secondary);
  font-size: 13px;
}

.user-copy strong {
  color: var(--text);
  font-weight: 500;
}

.user-copy small {
  font-size: 13px;
}

.user-copy small::before {
  content: " · ";
}

.text-button {
  padding: 4px 0;
  border: 0;
  color: var(--tint);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.text-button:hover {
  color: var(--tint-hover);
  text-decoration: underline;
}

.nav-toggle {
  display: none;
}

/* Sidebar */

.sidebar {
  position: fixed;
  z-index: 20;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 18px 16px 16px;
  background: var(--surface);
  overflow-y: auto;
}

.sidebar-filter {
  position: relative;
  margin-bottom: 22px;
}

.sidebar-filter svg {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--text-tertiary);
  stroke-linecap: round;
  stroke-width: 2;
  transform: translateY(-50%);
}

.sidebar-filter input {
  width: 100%;
  height: 30px;
  padding: 0 26px 0 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.sidebar-filter input::placeholder {
  color: var(--text-tertiary);
}

.sidebar-filter input:focus {
  border-color: var(--tint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 15%, transparent);
}

.sidebar-filter kbd {
  position: absolute;
  top: 50%;
  right: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  transform: translateY(-50%);
}

.nav-group-label {
  margin: 0 8px 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.nav-group-label:not(:first-of-type) {
  margin-top: 26px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-small);
  color: var(--text);
  font-size: 13px;
}

.nav-item:hover {
  color: var(--text);
  background: var(--fill);
  text-decoration: none;
}

.nav-item[aria-current="page"] {
  color: var(--surface);
  background: var(--text);
  font-weight: 500;
}

.nav-item .product-dot {
  margin: 0 2px;
}

.product-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.product-dot--cab { color: var(--cab); }
.product-dot--sensor { color: var(--sensor); }
.product-dot--tag { color: var(--tag); }

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--hairline-light);
  color: var(--text-tertiary);
  font-size: 12px;
}

.sidebar-foot code {
  max-width: 110px;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
}

.sidebar-scrim {
  display: none;
}

/* Content grid */

.content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 40px) 40px 48px;
}

.content:focus {
  outline: 0;
}

.doc {
  display: grid;
  max-width: calc(var(--content-max) + var(--rail-width) + 72px);
  margin: 0 auto;
  grid-template-columns: minmax(0, var(--content-max)) var(--rail-width);
  gap: 72px;
}

.doc-main {
  min-width: 0;
}

/* Right rail */

.doc-rail {
  font-size: 12px;
}

.rail-inner {
  position: sticky;
  top: calc(var(--topbar-height) + 40px);
}

.rail-label {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 600;
}

.rail-inner nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-inner nav a {
  color: var(--text-secondary);
  line-height: 1.35;
}

.rail-inner nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.rail-inner nav a.is-active {
  color: var(--tint);
  font-weight: 600;
}

.rail-devices {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline-light);
  color: var(--text-secondary);
}

.rail-devices span {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Document header */

.changelog {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 44px;
  padding: 14px 18px;
  border-radius: var(--radius-medium);
  background: var(--fill);
}

.changelog time {
  color: var(--text-secondary);
  font-size: 12px;
}

.changelog p {
  margin: 0;
  font-size: 14px;
}

.doc-header {
  margin-bottom: 44px;
}

.doc-eyebrow {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.doc-eyebrow a {
  color: inherit;
}

.doc-eyebrow a:hover {
  color: var(--text);
}

.doc-header h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

.doc-abstract {
  margin: 18px 0 0;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.4;
}

/* Hero */

.hero {
  margin: 0 0 8px;
}

.hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  border-radius: var(--radius-large);
  background: var(--fill);
}

.hero-art svg {
  width: min(600px, 100%);
  height: auto;
  color: var(--text);
}

.hero-art img {
  width: min(600px, 100%);
  height: auto;
  border-radius: var(--radius-medium);
}

.hero figcaption {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

#gallery .card-grid {
  align-items: stretch;
}

#gallery .hero {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
}

#gallery .hero-art {
  flex: 1 1 auto;
  min-height: 180px;
}

#gallery .hero figcaption {
  flex: 0 0 auto;
  margin-top: 14px;
}

.hero-caption {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.hero-caption--plain {
  padding-left: 14px;
}

.hero-caption a {
  white-space: nowrap;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Media cards (board gallery) */

a.card--media {
  padding: 0;
  overflow: hidden;
}

.card--media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card--media .card-body {
  padding: 13px 16px 15px;
}

.card--media h3 {
  margin-bottom: 3px;
  font-size: 15px;
}

.hero .art-tint {
  color: var(--tint);
}

.hero .art-secondary {
  color: var(--text-tertiary);
}

/* Sections */

.doc-section {
  padding-top: 64px;
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.doc-header + .doc-section {
  padding-top: 0;
}

.doc-section h2 {
  margin: 0 0 18px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.016em;
  line-height: 1.15;
}

.section-lede {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.55;
}

.doc-section h2 + .section-lede {
  margin-top: -6px;
}

.table-wrap + .section-lede,
.table-wrap + p,
.table-wrap + h3,
.table-wrap + .guidance,
.table-wrap + .spec-list,
.spec-list + .section-lede,
.guidance + .section-lede,
article + .section-lede {
  margin-top: 32px;
}

.section-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 15px;
}

.section-link::after {
  content: " ›";
}

/* System flow */

.system-flow {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  list-style: none;
}

.system-step {
  min-width: 0;
}

.step-number {
  display: block;
  margin-bottom: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.system-step h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.step-role {
  display: block;
  margin: 2px 0 10px;
  color: var(--tint);
  font-size: 13px;
  font-weight: 600;
}

.system-step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.step-meta {
  display: block;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Platform-style filter tabs */

.filter-tabs {
  display: flex;
  gap: 26px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}

.filter-chip {
  padding: 9px 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.filter-chip:hover {
  color: var(--text);
}

.filter-chip.is-active {
  border-bottom-color: var(--text);
  color: var(--text);
  font-weight: 500;
}

/* Tables */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.data-table td {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--hairline-light);
  color: var(--text-secondary);
  font-size: 14px;
  vertical-align: top;
}

.data-table tr > :last-child {
  padding-right: 0;
}

.data-table code,
.spec-list code {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.data-table td {
  overflow-wrap: anywhere;
}

/* Keep the term/label first column readable: give it room and stop
   single-word terms and part numbers breaking mid-character. Inline
   <code> keeps its own overflow-wrap:anywhere from the rule above. */
.data-table td:first-child,
.data-table th[scope="row"] {
  min-width: 150px;
  overflow-wrap: normal;
}

/* Compact modifier for very wide matrix tables (many narrow columns).
   Opt in per table with class="data-table data-table--matrix". */
.data-table--matrix th,
.data-table--matrix td {
  padding-left: 8px;
  padding-right: 8px;
  font-size: 13px;
}

.data-table--matrix td:first-child,
.data-table--matrix th[scope="row"] {
  min-width: 0;
}

.product-name,
.repository-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  color: var(--text);
  font-weight: 500;
}

.product-name > span {
  display: flex;
  flex-direction: column;
}

.product-name small {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 400;
}

.capability-list {
  line-height: 1.55;
}

.table-link {
  font-size: 14px;
  white-space: nowrap;
}

.empty-filter {
  margin: 0;
  padding: 28px 0;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: currentColor;
}

.status--active {
  color: var(--success);
}

.status--review {
  color: var(--warning);
}

/* Guidance (bold-lead) paragraphs */

.guidance {
  max-width: 100%;
}

.guidance + .guidance {
  margin-top: 22px;
}

.guidance p {
  margin: 0;
  line-height: 1.55;
}

.guidance strong {
  font-weight: 600;
}

.guidance a {
  white-space: nowrap;
}

.guidance a::after {
  content: " ›";
}

/* Cards */

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

a.card {
  display: block;
  padding: 20px;
  border-radius: 14px;
  color: var(--text);
  background: var(--fill);
}

a.card:hover {
  background: var(--fill-hover);
  text-decoration: none;
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.card-meta {
  display: block;
  margin-top: 12px;
  color: var(--tint);
  font-size: 13px;
}

/* Code blocks */

pre {
  position: relative;
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: var(--radius-medium);
  background: var(--fill);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

pre code {
  font-size: inherit;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  color: var(--text-secondary);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  opacity: 0;
  transition: opacity 120ms ease;
}

pre:hover .copy-button,
.copy-button:focus-visible {
  opacity: 1;
}

.copy-button:hover {
  color: var(--text);
}

/* Audio buttons */

.audio-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: var(--tint);
  background: var(--tint-soft);
  cursor: pointer;
  vertical-align: middle;
}

.audio-button:hover {
  color: var(--surface);
  background: var(--tint);
}

.audio-button svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.audio-button .icon-pause {
  display: none;
}

.audio-button.is-playing .icon-play {
  display: none;
}

.audio-button.is-playing .icon-pause {
  display: block;
}

/* External links */

.ext::after {
  content: " ↗";
  font-size: 0.8em;
}

/* Hardware reference */

.device-section {
  padding-top: 72px;
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.device-heading {
  margin-bottom: 14px;
}

.device-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.device-title .product-dot {
  align-self: center;
  width: 9px;
  height: 9px;
}

.device-title h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.016em;
  line-height: 1.15;
}

.device-title .device-code {
  color: var(--text-tertiary);
  font-size: 17px;
  font-weight: 400;
}

.device-heading .status {
  margin-top: 8px;
}

.device-summary {
  margin: 0 0 32px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.55;
}

.device-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
}

.device-layout + .device-layout {
  margin-top: 44px;
}

.device-layout h3 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.device-layout ul + h3 {
  margin-top: 34px;
}

.spec-list {
  margin: 0;
}

.spec-list > div {
  display: grid;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-light);
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.spec-list > div:first-of-type {
  border-top: 1px solid var(--hairline-light);
}

.spec-list dt {
  color: var(--text-secondary);
  font-size: 14px;
}

.spec-list dd {
  margin: 0;
  font-size: 14px;
}

.feature-list,
.verification-list {
  margin: 0;
  padding-left: 20px;
}

.feature-list li,
.verification-list li {
  margin: 7px 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.verification-list {
  padding: 0;
  list-style: none;
}

.verification-list li {
  position: relative;
  padding-left: 24px;
}

.verification-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--text-tertiary);
  content: "○";
}

.verification-list .is-known::before {
  color: var(--success);
  content: "✓";
}

.note {
  margin: 24px 0 0;
  padding: 16px 20px;
  border-radius: var(--radius-medium);
  background: var(--fill);
  font-size: 14px;
  line-height: 1.55;
}

.note-label {
  display: block;
  margin-bottom: 4px;
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.note strong {
  font-weight: 600;
}

.note p {
  margin: 0;
  color: var(--text-secondary);
}

/* Footer */

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-light);
  color: var(--text-tertiary);
  font-size: 12px;
}

.page-footer p {
  margin: 0;
}

.page-footer code {
  color: var(--text-secondary);
}

/* Errors */

.error-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background: var(--surface);
}

.error-card {
  width: min(440px, 100%);
  padding-bottom: 8vh;
  text-align: center;
}

.error-card .brand-mark {
  margin: 0 auto 30px;
}

.error-card .eyebrow {
  margin: 0 0 4px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.error-card h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.error-card p:not(.eyebrow) {
  margin: 14px 0 24px;
  color: var(--text-secondary);
}

.error-card a:not(.brand)::after {
  content: " ›";
}

/* Responsive */

@media (max-width: 1200px) {
  .doc {
    max-width: var(--content-max);
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-rail {
    display: none;
  }
}

@media (max-width: 960px) {
  .topbar {
    padding: 0 16px;
  }

  .nav-toggle {
    display: flex;
    width: 34px;
    height: 34px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-right: 12px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-small);
    background: transparent;
    cursor: pointer;
  }

  .nav-toggle:hover {
    background: var(--fill);
  }

  .nav-toggle span {
    width: 15px;
    height: 1.5px;
    border-radius: 1px;
    background: var(--text);
  }

  .sidebar {
    border-right: 1px solid var(--hairline-light);
    box-shadow: 0 12px 32px rgb(0 0 0 / 8%);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 15;
    inset: var(--topbar-height) 0 0;
    display: block;
    background: rgb(0 0 0 / 28%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    margin-left: 0;
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (max-width: 760px) {
  .doc-header {
    margin-bottom: 36px;
  }

  .doc-abstract {
    font-size: 19px;
  }

  .doc-section {
    padding-top: 52px;
  }

  .doc-section h2 {
    font-size: 27px;
  }

  .device-section {
    padding-top: 56px;
  }

  .device-title h2 {
    font-size: 27px;
  }

  .system-flow,
  .device-layout {
    grid-template-columns: 1fr;
  }

  .hero-art {
    padding: 26px 18px;
  }

  .page-footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 600px) {
  .user-copy {
    display: none;
  }

  .filter-tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .spec-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Kiosk demo -------------------------------------------------------------- */
/* Interactive mock of station/allclear_station/web/index.html. The screen
   (.kiosk-frame) keeps the real station's always-dark 7" panel identity via
   literal --k-* tokens; the reader controls below it stay theme-aware. */
.kiosk-demo {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(600px, 100%);
}

.kiosk-frame {
  --k-bg: #161916;
  --k-panel: #1e221e;
  --k-line: #2e352e;
  --k-line-strong: #465146;
  --k-ink: #edf2ea;
  --k-ink-dim: #a7b3a2;
  --k-ink-faint: #788776;
  --k-amber: #ffb000;
  --k-green: #3fdc85;
  --k-green-dim: #14512e;
  --k-red: #ff5546;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--k-line-strong);
  background: var(--k-bg);
  color: var(--k-ink);
  font-family: var(--font-body);
}

.kiosk-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--k-line-strong);
  background: var(--k-bg);
}

.kiosk-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--k-ink);
}

.kiosk-brand b {
  color: var(--k-amber);
  font-weight: 700;
}

.kiosk-badge {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--k-line-strong);
  border-radius: 999px;
}

.kiosk-badge-name {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--k-ink);
}

.kiosk-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px 11px;
  border: 0;
  border-left: 1px solid var(--k-line-strong);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--k-red);
  background: rgba(255, 85, 70, 0.08);
  cursor: pointer;
}

.kiosk-demo[data-online="true"] .kiosk-link {
  color: var(--k-green);
  background: rgba(63, 220, 133, 0.08);
}

.kiosk-link:focus-visible {
  outline: 2px solid var(--k-amber);
  outline-offset: 2px;
}

.kiosk-lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--k-red);
  box-shadow: 0 0 8px var(--k-red);
}

.kiosk-demo[data-online="true"] .kiosk-lamp {
  background: var(--k-green);
  box-shadow: 0 0 8px var(--k-green);
}

.kiosk-lane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.kiosk-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kiosk-lane-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--k-ink);
}

.kiosk-stateword {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--k-ink-dim);
}

.kiosk-demo[data-online="false"] .kiosk-stateword {
  color: var(--k-amber);
}

.kiosk-demo[data-outcome="pass"] .kiosk-stateword {
  color: var(--k-green);
}

.kiosk-phases {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kiosk-phases li {
  flex: 1;
  padding-top: 5px;
  border-top: 2px solid var(--k-line);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--k-ink-faint);
}

.kiosk-phases li.done {
  color: var(--k-ink-dim);
  border-top-color: var(--k-green-dim);
}

.kiosk-phases li.now {
  color: var(--k-green);
  border-top-color: var(--k-green);
}

.kiosk-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  border-radius: 10px;
  border: 1px solid var(--k-line);
  background: var(--k-panel);
  text-align: center;
}

.kiosk-demo[data-outcome="pass"] .kiosk-stage {
  border-color: var(--k-green-dim);
  background: rgba(63, 220, 133, 0.06);
}

.kiosk-serial-cap {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--k-ink-dim);
}

.kiosk-demo[data-outcome="pass"] .kiosk-serial-cap {
  color: var(--k-green);
}

/* The signature moment: the leased serial revealed big and monospace. */
.kiosk-serial {
  font-family: var(--font-mono);
  font-size: clamp(30px, 7vw, 44px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #f2f3e8;
  text-shadow: 0 0 14px rgba(242, 243, 232, 0.10);
  overflow-wrap: break-word;
}

.kiosk-serial[data-empty="true"] {
  color: var(--k-ink-faint);
  text-shadow: none;
}

.kiosk-demo[data-outcome="pass"] .kiosk-serial {
  animation: kiosk-serial-in 0.3s ease;
}

@keyframes kiosk-serial-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

.kiosk-marquee {
  margin: 0;
  min-height: 1.2em;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--k-ink-dim);
}

.kiosk-demo[data-online="false"] .kiosk-marquee {
  color: var(--k-amber);
}

.kiosk-demo[data-outcome="pass"] .kiosk-marquee {
  color: var(--k-green);
}

.kiosk-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.kiosk-btn {
  padding: 9px 20px;
  border-radius: var(--radius-small);
  border: 1px solid var(--hairline);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.kiosk-btn--step {
  border-color: transparent;
  color: var(--surface);
  background: var(--text);
}

.kiosk-btn:hover {
  background: var(--fill-hover);
}

.kiosk-btn--step:hover {
  background: var(--text);
  opacity: 0.85;
}

.kiosk-btn:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 2px;
}

.kiosk-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.kiosk-btn:disabled:hover {
  background: var(--surface);
  opacity: 0.4;
}

.kiosk-btn--step:disabled:hover {
  background: var(--text);
  opacity: 0.4;
}

.kiosk-hint {
  flex: 1 1 180px;
  min-width: 160px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-tertiary);
}

@media (prefers-reduced-motion: reduce) {
  .kiosk-demo[data-outcome="pass"] .kiosk-serial {
    animation: none;
  }
}

/* Lightbox ---------------------------------------------------------------- */
/* Progressive-enhancement image viewer. The trigger cursor is styled here;
   the overlay itself is built and controlled from site.js. The dimmed
   backdrop reads correctly against both light and dark pages. */

.hero-art img,
a.card--media img {
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  background: rgb(0 0 0 / 72%);
  opacity: 0;
  transition: opacity 140ms ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.lightbox.is-zoomed .lightbox-stage {
  cursor: grab;
}

.lightbox.is-panning .lightbox-stage {
  cursor: grabbing;
}

.lightbox-image {
  max-width: 92vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  box-shadow: 0 24px 64px rgb(0 0 0 / 46%);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 16%);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox-close:hover {
  background: rgb(255 255 255 / 28%);
}

.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.lightbox-caption {
  position: absolute;
  z-index: 2;
  bottom: 44px;
  left: 50%;
  max-width: min(80vw, 680px);
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 1px 3px rgb(0 0 0 / 55%);
  transform: translateX(-50%);
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-hint {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  left: 50%;
  max-width: 90vw;
  margin: 0;
  color: rgb(255 255 255 / 62%);
  font-size: 11px;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
}
