/* PylotOS Official Website & Documentation Stylesheet
 * Built strictly on PylotOS 2B-2 Brand Tokens (docs/assets/brand/BRAND.md).
 */

:root {
  --pylot-bg: #0b1120;
  --pylot-bg-elevated: #0f172a;
  --pylot-surface: #1e293b;
  --pylot-surface-hover: #26344b;
  --pylot-border: #334155;
  --pylot-cyan: #38bdf8;
  --pylot-cyan-dim: #0284c7;
  --pylot-gold: #f59e0b;
  --pylot-gold-hi: #fbbf24;
  --pylot-white: #f8fafc;
  --pylot-text: #cbd5e1;
  --pylot-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--pylot-bg);
  color: var(--pylot-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--pylot-cyan);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  color: #7dd3fc;
}

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

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 17, 32, 0.9);
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-link img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--pylot-border);
  background: rgba(30, 41, 59, 0.85);
  color: var(--pylot-white);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  background: var(--pylot-surface-hover);
  border-color: var(--pylot-cyan);
  color: var(--pylot-cyan);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--pylot-text);
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--pylot-white);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pylot-cyan), #0ea5e9);
  color: #06101f;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.24);
}

.btn-primary:hover {
  color: #06101f;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.34);
}

.btn-secondary {
  background: var(--pylot-surface);
  color: var(--pylot-white);
  border-color: var(--pylot-border);
}

.btn-secondary:hover {
  background: var(--pylot-surface-hover);
  color: var(--pylot-white);
}

.btn-gold {
  background: rgba(245, 158, 11, 0.14);
  color: var(--pylot-gold-hi);
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-gold:hover {
  background: rgba(245, 158, 11, 0.24);
  color: var(--pylot-gold-hi);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.86rem;
}

/* Container & Sections */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 76px 0;
}

.section-header {
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--pylot-cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-title {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--pylot-white);
  line-height: 1.2;
}

.section-lead {
  margin: 0;
  max-width: 720px;
  color: var(--pylot-muted);
  font-size: 1.05rem;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 74px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  background:
    radial-gradient(circle at 22% 38%, rgba(56, 189, 248, 0.16), transparent 46%),
    radial-gradient(circle at 84% 20%, rgba(245, 158, 11, 0.12), transparent 42%),
    linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(51, 65, 85, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 65, 85, 0.25) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
}

.hero h1 {
  margin: 18px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--pylot-white);
}

.hero h1 .accent-gold {
  color: var(--pylot-gold);
}

.hero h1 .accent-cyan {
  color: var(--pylot-cyan);
}

.hero-subtitle {
  margin: 0 0 28px;
  font-size: 1.12rem;
  color: var(--pylot-text);
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--pylot-muted);
}

.stat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--pylot-border);
}

.stat-pill strong {
  color: var(--pylot-white);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.mascot-stage {
  width: 280px;
  height: 280px;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.92) 70%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mascot-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.terminal-card {
  width: 100%;
  max-width: 472px;
  background: #070c17;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--pylot-surface);
  border-bottom: 1px solid var(--pylot-border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--pylot-muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-gold { background: var(--pylot-gold); }
.dot-cyan { background: var(--pylot-cyan); }

.terminal-card pre {
  margin: 0;
  padding: 14px 16px;
  font-size: 0.77rem;
  line-height: 1.6;
  color: #e2e8f0;
  overflow-x: auto;
}

.t-prompt { color: var(--pylot-gold); }
.t-cmd { color: var(--pylot-cyan); }
.t-comment { color: #64748b; }

/* Feature Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 20px;
}

.card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-2px);
}

.card-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--pylot-cyan);
}

.card-badge.gold {
  background: rgba(245, 158, 11, 0.14);
  color: var(--pylot-gold-hi);
}

.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--pylot-white);
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--pylot-muted);
}

/* Interactive Boards Table */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--pylot-surface);
  border: 1px solid var(--pylot-border);
  color: var(--pylot-text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active,
.filter-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--pylot-cyan);
  color: var(--pylot-white);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--pylot-border);
  background: rgba(15, 23, 42, 0.85);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

th {
  background: rgba(30, 41, 59, 0.85);
  color: var(--pylot-white);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(30, 41, 59, 0.42);
}

.chip-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-esp32 { background: rgba(56, 189, 248, 0.14); color: var(--pylot-cyan); }
.chip-esp32s3 { background: rgba(245, 158, 11, 0.16); color: var(--pylot-gold-hi); }
.chip-esp32c6 { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }

.ref-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Callout / Flasher Banner */
.flasher-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 20%, rgba(245, 158, 11, 0.14), transparent 50%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--pylot-border);
}

.boot-previews {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.boot-frame {
  background: #050810;
  border: 2px solid var(--pylot-border);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}

.boot-frame img {
  display: block;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

.boot-frame span {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--pylot-muted);
}

/* Documentation Layout */
.docs-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 76px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.docs-search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--pylot-border);
  background: var(--pylot-bg);
  color: var(--pylot-white);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.docs-search:focus {
  outline: none;
  border-color: var(--pylot-cyan);
}

.sidebar-group {
  margin: 14px 0 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pylot-gold);
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-list li {
  margin: 2px 0;
}

.sidebar-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--pylot-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-list a:hover {
  background: rgba(30, 41, 59, 0.75);
  color: var(--pylot-white);
}

.sidebar-list a.active {
  background: rgba(56, 189, 248, 0.16);
  color: var(--pylot-cyan);
  font-weight: 700;
}

.doc-article {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  min-width: 0;
}

.doc-article h1 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--pylot-white);
  border-bottom: 1px solid var(--pylot-border);
  padding-bottom: 14px;
}

.doc-article h2 {
  margin-top: 34px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--pylot-white);
}

.doc-article h3 {
  margin-top: 24px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--pylot-gold-hi);
}

.doc-article p code,
.doc-article li code,
.doc-article td code {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(51, 65, 85, 0.8);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.86em;
  color: #e0f2fe;
}

.doc-article pre {
  background: #070c17;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.doc-article blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--pylot-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--pylot-text);
}

.doc-article blockquote.alert-warning {
  border-left-color: var(--pylot-gold);
  background: rgba(245, 158, 11, 0.1);
}

.doc-article hr {
  border: none;
  border-top: 1px solid var(--pylot-border);
  margin: 28px 0;
}

.doc-article ul,
.doc-article ol {
  padding-left: 22px;
}

.doc-article li {
  margin: 6px 0;
}

.doc-article .table-wrap {
  margin: 20px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(51, 65, 85, 0.7);
  padding: 36px 0 46px;
  color: var(--pylot-muted);
  font-size: 0.88rem;
}

/* Web Flasher Page (/flash/) */
.flasher-hero {
  padding: 52px 0 36px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  background:
    radial-gradient(circle at 18% 30%, rgba(56, 189, 248, 0.14), transparent 46%),
    radial-gradient(circle at 86% 24%, rgba(245, 158, 11, 0.12), transparent 40%),
    linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
}

.flasher-hero h1 {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--pylot-white);
}

.flasher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 28px;
  align-items: start;
  padding: 34px 0 64px;
}

.board-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.board-card {
  text-align: left;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--pylot-border);
  color: var(--pylot-text);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
  font-family: inherit;
}

.board-card:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(30, 41, 59, 0.72);
  transform: translateY(-2px);
}

.board-card.selected {
  border-color: var(--pylot-cyan);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.96));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.board-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.board-card-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--pylot-white);
  margin: 0 0 4px;
}

.board-card-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--pylot-muted);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #6ee7b7;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.status-dot.offline {
  color: var(--pylot-gold-hi);
}

.status-dot.offline::before {
  background: var(--pylot-gold);
}

.flash-station {
  position: sticky;
  top: 78px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

.flash-station h2 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--pylot-white);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.spec-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(11, 17, 32, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.75);
}

.spec-box span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pylot-muted);
}

.spec-box strong {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--pylot-white);
}

.boot-hint {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--pylot-gold);
  background: rgba(245, 158, 11, 0.1);
  color: var(--pylot-text);
  font-size: 0.89rem;
  margin-bottom: 18px;
}

.boot-hint strong {
  color: var(--pylot-gold-hi);
}

.flash-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

esp-web-install-button {
  --esp-tools-button-color: #38bdf8;
  --esp-tools-button-text-color: #06101f;
  display: block;
}

.btn-flash-lg {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
}

.browser-warning {
  display: none;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: var(--pylot-gold-hi);
  font-size: 0.9rem;
  margin-top: 16px;
}

.cli-box {
  background: #070c17;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.78rem;
  color: #e2e8f0;
  overflow-x: auto;
  margin: 8px 0 0;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.step-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.18);
  color: var(--pylot-cyan);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.84rem;
  margin-bottom: 10px;
}

/* Web Flasher NVS Pre-Provisioning Accordion */
.prov-panel {
  margin-bottom: 18px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  background: rgba(11, 17, 32, 0.78);
  overflow: hidden;
}

.prov-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--pylot-white);
  user-select: none;
}

.prov-summary::-webkit-details-marker {
  display: none;
}

.prov-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(148, 163, 184, 0.16);
  color: var(--pylot-muted);
}

.prov-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.prov-body {
  padding: 4px 14px 14px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.prov-note {
  margin: 10px 0 12px;
  font-size: 0.79rem;
  color: var(--pylot-muted);
}

.prov-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prov-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prov-field span {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--pylot-text);
}

.prov-field input[type="text"],
.prov-field input[type="password"],
.prov-field select {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--pylot-border);
  background: #070c17;
  color: var(--pylot-white);
  font-size: 0.83rem;
  font-family: inherit;
}

.prov-field input:focus,
.prov-field select:focus {
  outline: none;
  border-color: var(--pylot-cyan);
}

.prov-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.82rem;
  color: var(--pylot-text);
  cursor: pointer;
}

.prov-actions {
  display: flex;
  gap: 8px;
}

.prov-status {
  margin-top: 8px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--pylot-cyan);
}

.prov-status.ok {
  color: #6ee7b7;
}

.prov-status.warn {
  color: var(--pylot-gold-hi);
}

/* Built-In WebSerial USB TTY Console */
.tty-section {
  padding-bottom: 72px;
}

.tty-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(7, 12, 23, 0.98));
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.tty-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tty-header > div:first-child {
  flex: 1 1 420px;
  min-width: 0;
}

.tty-controls {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.tty-quickbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tty-quickbar .filter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tty-screen {
  margin: 0 0 12px;
  height: 260px;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #04070f;
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tty-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tty-prompt-lbl {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pylot-gold-hi);
  white-space: nowrap;
}

.tty-prompt-lbl.wlan {
  color: var(--pylot-cyan);
}

.tty-prompt-lbl.offline {
  color: var(--pylot-muted);
}

.tty-input-row input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--pylot-border);
  background: #070c17;
  color: var(--pylot-white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.tty-input-row input:focus {
  outline: none;
  border-color: var(--pylot-cyan);
}

/* Live USB Display Mirror & Screenshot Panel */
.tty-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lcd-mirror-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 23, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.lcd-mirror-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lcd-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcd-source-row select {
  flex: 1;
  min-width: 0;
}

.lcd-mirror-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pylot-white);
}

.lcd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  color: var(--pylot-muted);
  border: 1px solid var(--pylot-border);
}

.lcd-badge.live {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.48);
}

.lcd-badge.snap {
  background: rgba(56, 189, 248, 0.16);
  color: var(--pylot-cyan);
  border-color: rgba(56, 189, 248, 0.45);
}

.lcd-bezel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 10px;
  background: #03060c;
  border: 2px solid #1e293b;
  min-height: 168px;
  overflow: hidden;
}

.lcd-bezel.flash {
  border-color: var(--pylot-cyan);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

#lcd-canvas {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 4px;
  background: #0b1120;
  image-rendering: -moz-crisp-edges;
  image-rendering: pixelated;
}

.lcd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lcd-scale-select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--pylot-border);
  background: #0b1120;
  color: var(--pylot-white);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.lcd-remotekeys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.lcd-remotekeys .filter-btn {
  padding: 4px 9px;
  font-size: 0.76rem;
}

.btn-live-on {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #03150e !important;
  border-color: transparent !important;
}

/* Multi-Brand Web Flasher Controls & Tags */
.flasher-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.flasher-filters .filter-bar {
  margin-bottom: 0;
}

.board-search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--pylot-border);
  background: rgba(15, 23, 42, 0.92);
  color: var(--pylot-white);
  font-size: 0.9rem;
}

.board-search-input:focus {
  outline: none;
  border-color: var(--pylot-cyan);
}

.board-card-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vendor-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.chip-esp32c3 {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}

/* LAN Wireless OTA & Fleet Manager */
.ota-section {
  padding-bottom: 56px;
}

.ota-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(7, 12, 23, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.ota-https-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.1);
  color: var(--pylot-gold-hi);
  font-size: 0.83rem;
  line-height: 1.45;
}

.ota-banner-close {
  background: transparent;
  border: none;
  color: var(--pylot-gold-hi);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.8;
}

.ota-banner-close:hover {
  opacity: 1;
}

.ota-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(250px, 1.15fr) minmax(220px, 0.95fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.ota-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ota-sub-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pylot-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.ota-input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.ota-input-row input {
  flex: 1;
  min-width: 0;
}

.ota-input-row .btn {
  flex-shrink: 0;
}

.ota-source-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(11, 17, 32, 0.78);
  border: 1px solid var(--pylot-border);
  margin-bottom: 14px;
}

.ota-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ota-src-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--pylot-border);
  background: rgba(15, 23, 42, 0.85);
  color: var(--pylot-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.ota-src-tab.active {
  border-color: var(--pylot-cyan);
  background: rgba(56, 189, 248, 0.14);
  color: var(--pylot-white);
}

.ota-custom-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.ota-custom-info {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--pylot-muted);
}

.ota-custom-info.ok {
  color: #6ee7b7;
}

.ota-custom-info.warn {
  color: var(--pylot-gold-hi);
}

.ota-scan-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ota-scan-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--pylot-cyan);
}

.ota-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ota-conc-lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--pylot-muted);
}

.ota-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ota-table th,
.ota-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  text-align: left;
  vertical-align: middle;
}

.ota-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pylot-muted);
}

.ota-empty {
  text-align: center !important;
  color: var(--pylot-muted);
  padding: 26px 14px !important;
}

.ota-dev-name {
  font-weight: 700;
  color: var(--pylot-white);
}

.ota-dev-sub {
  font-size: 0.74rem;
  color: var(--pylot-muted);
  margin-top: 2px;
}

.ota-tgt {
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.ota-tgt.muted {
  color: var(--pylot-gold-hi);
}

.ota-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.ota-pill.key {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.ota-pill.ask {
  background: rgba(245, 158, 11, 0.18);
  color: var(--pylot-gold-hi);
}

.ota-progress-wrap {
  width: 100%;
  min-width: 120px;
  height: 7px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
  margin-bottom: 4px;
}

.ota-progress-bar {
  height: 100%;
  background: var(--pylot-cyan);
  transition: width 0.16s ease;
}

.ota-progress-bar.ok {
  background: #10b981;
}

.ota-progress-bar.err {
  background: #ef4444;
}

.ota-row-msg {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--pylot-muted);
}

.ota-row-msg.ok {
  color: #6ee7b7;
}

.ota-row-msg.err {
  color: #fca5a5;
}

.ota-row-msg.busy {
  color: var(--pylot-cyan);
}

/* --- Dedicated App & Config Studio (/apps/) --- */
.apps-group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.apps-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apps-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin-top: 22px;
  margin-bottom: 56px;
  align-items: start;
}

.studio-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.94));
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.studio-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--pylot-border);
  padding-bottom: 10px;
}

.studio-file-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.studio-file-tab {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--pylot-border);
  color: var(--pylot-muted);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.studio-file-tab.active {
  color: var(--pylot-cyan);
  border-color: var(--pylot-cyan);
  background: rgba(56, 189, 248, 0.14);
}

.studio-editor {
  width: 100%;
  min-height: 290px;
  background: #060b16;
  color: #e2e8f0;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.48;
  resize: vertical;
}

.studio-editor:focus {
  outline: none;
  border-color: var(--pylot-cyan);
}

.var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.var-chip {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--pylot-cyan);
  border-radius: 999px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  cursor: pointer;
}

.var-chip:hover {
  background: rgba(56, 189, 248, 0.22);
}

.override-row {
  background: rgba(11, 17, 32, 0.75);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.override-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.override-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.override-ta {
  min-height: 74px;
  font-size: 0.79rem;
}

.studio-deploy-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--pylot-border);
}

.studio-deploy-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--pylot-text);
}

.storage-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 17, 32, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.7);
  overflow: hidden;
  margin: 8px 0 4px;
}

.storage-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pylot-cyan), var(--pylot-gold));
  transition: width 0.2s ease;
}

.apps-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  color: var(--pylot-muted);
}

.apps-badge.run {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.apps-badge.boot {
  background: rgba(245, 158, 11, 0.18);
  color: var(--pylot-gold-hi);
}

.apps-badge.cfg {
  background: rgba(56, 189, 248, 0.16);
  color: var(--pylot-cyan);
}

.apps-badge.bak {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
}

.apps-badge.git {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.apps-badge.stale {
  background: rgba(245, 158, 11, 0.2);
  color: var(--pylot-gold-hi);
}

.gh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.watcher-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
  font-size: 0.8rem;
}

.watcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

.heap-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.16);
  color: var(--pylot-muted);
}

.heap-pill.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.heap-pill.warn {
  background: rgba(245, 158, 11, 0.2);
  color: var(--pylot-gold-hi);
}

.heap-pill.leak {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

.devhooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 8px;
}

.devhook-metric {
  background: rgba(6, 11, 22, 0.85);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
}

.devhook-metric-k {
  font-size: 0.7rem;
  color: var(--pylot-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.devhook-metric-v {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pylot-cyan);
  margin-top: 2px;
  word-break: break-word;
}

.devhooks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.devhooks-result {
  margin-top: 10px;
  background: #050914;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #a7f3d0;
  white-space: pre-wrap;
  max-height: 110px;
  overflow-y: auto;
}

.logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logs-heap-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.app-log-console {
  background: #050914;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.42;
  color: #cbd5e1;
  min-height: 150px;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
}

.multi-log-console {
  min-height: 210px;
  max-height: 360px;
}

.log-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 1px 0;
}

.log-board-tag {
  font-weight: 700;
  white-space: nowrap;
}

.log-lvl-error {
  color: #fca5a5;
}

.log-lvl-warn {
  color: #fcd34d;
}

.log-lvl-info {
  color: #7dd3fc;
}

.log-lvl-watch {
  color: #6ee7b7;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-disclaimer {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #64748b;
}

.docs-sidebar {
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.docs-nav-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--pylot-border);
  background: rgba(30, 41, 59, 0.75);
  color: var(--pylot-white);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.docs-nav-toggle:hover,
.docs-nav-toggle[aria-expanded="true"] {
  border-color: var(--pylot-cyan);
  color: var(--pylot-cyan);
}

.docs-nav-chevron {
  transition: transform 0.18s ease;
  font-size: 0.85rem;
}

.docs-sidebar.open .docs-nav-chevron {
  transform: rotate(180deg);
}

.doc-article p code,
.doc-article li code,
.doc-article td code,
.doc-article a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.doc-article img {
  max-width: 100%;
  height: auto;
}

.table-wrap,
.doc-article pre,
.terminal-card pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hero-inner > *,
.cards-grid > *,
.flasher-panel > *,
.studio-card {
  min-width: 0;
}

@media (max-width: 1080px) {
  .apps-studio-grid,
  .studio-top-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .nav-inner {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-header .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 0 6px;
    border-top: 1px solid rgba(51, 65, 85, 0.75);
  }

  .site-header.nav-open .nav-links {
    display: flex;
  }

  .site-header .nav-links a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 10px;
    font-size: 0.98rem;
  }

  .site-header .nav-links a:hover,
  .site-header .nav-links a.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--pylot-cyan);
  }

  .site-header .nav-links a.btn {
    margin-top: 6px;
    justify-content: center;
  }

  .hero-inner,
  .flasher-panel,
  .flasher-layout,
  .ota-toolbar,
  .tty-workspace,
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .board-picker-grid {
    grid-template-columns: 1fr;
  }

  .docs-shell {
    padding: 16px 16px 48px;
    gap: 16px;
  }

  .docs-sidebar,
  .flash-station {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .docs-sidebar {
    padding: 10px;
  }

  .docs-nav-toggle {
    display: flex;
  }

  .docs-sidebar-body {
    display: none;
    margin-top: 12px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
  }

  .docs-sidebar.open .docs-sidebar-body {
    display: block;
  }

  .doc-article {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }

  .hero {
    padding: 46px 0 42px;
  }

  .hero-inner {
    gap: 28px;
  }

  .section {
    padding: 52px 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner .nav-links {
    gap: 10px 16px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .brand-link img {
    height: 32px;
  }

  .hero {
    padding: 34px 0 32px;
  }

  .eyebrow {
    font-size: 0.7rem;
    padding: 4px 10px;
    max-width: 100%;
    white-space: normal;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 7.6vw, 2.3rem);
    line-height: 1.15;
  }

  .hero-subtitle {
    font-size: 0.96rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .hero-stats {
    gap: 8px;
  }

  .stat-pill {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card,
  .flasher-panel,
  .studio-card {
    padding: 18px 16px;
  }

  .docs-shell {
    padding: 12px 12px 40px;
  }

  .doc-article {
    padding: 18px 14px;
  }

  .doc-article h1 {
    font-size: 1.52rem;
    line-height: 1.25;
  }

  .doc-article h2 {
    font-size: 1.24rem;
    margin-top: 26px;
  }

  .doc-article h3 {
    font-size: 1.05rem;
  }

  .doc-article pre {
    padding: 12px;
    font-size: 0.8rem;
  }

  .doc-article blockquote {
    padding: 10px 12px;
  }

  table {
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 9px 10px;
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 11px;
    font-size: 0.78rem;
  }

  .terminal-card pre {
    font-size: 0.78rem;
    padding: 12px;
  }

  .flasher-hero {
    padding: 32px 0 24px;
  }

  .flasher-layout {
    padding: 20px 0 40px;
    gap: 18px;
  }
}
