/* Public /docs — mobile-first responsive wiki */

.docs-container.main-content {
  padding-top: 0.75rem;
  padding-bottom: 2rem;
  max-width: 72rem;
}

.docs-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  min-width: 0;
}

.docs-toc-wrap {
  position: relative;
  z-index: 5;
}

.docs-toc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.docs-toc-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5a6f7a;
}

/* Beat app.css `.admin-burger { display: none }` until the site-nav breakpoint. */
.docs-toc-burger.admin-burger {
  display: inline-flex;
}

.docs-sidebar {
  display: none;
  padding: 0.85rem 1rem;
  border: 1px solid #d9e2e8;
  border-radius: 0.6rem;
  background: #f8fbfc;
  max-height: min(70dvh, 32rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.docs-sidebar.is-open {
  display: block;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  width: 100%;
  box-shadow: 0 12px 28px rgba(0, 40, 60, 0.14);
  z-index: 25;
}

.docs-sidebar a {
  display: block;
  padding: 0.45rem 0.15rem;
  color: #07577c;
  text-decoration: none;
  min-height: 2.5rem;
  line-height: 1.35;
}

.docs-sidebar a:hover,
.docs-sidebar a:focus-visible {
  color: #003f5d;
  text-decoration: underline;
}

.docs-sidebar a.active {
  font-weight: 700;
  color: #003f5d;
}

.docs-nav-group {
  margin: 0.65rem 0 0.25rem;
}

.docs-nav-group-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a6f7a;
  margin-bottom: 0.15rem;
}

.docs-nav-group.is-open .docs-nav-group-label {
  color: #003f5d;
}

.docs-nav-children {
  margin: 0 0 0.35rem 0.55rem;
  padding-left: 0.55rem;
  border-left: 2px solid #cfe0e8;
}

.docs-nav-children a {
  font-size: 0.95rem;
  padding: 0.35rem 0.1rem;
  min-height: 2.35rem;
}

.docs-article {
  min-width: 0;
  max-width: 52rem;
}

.docs-article h1 {
  font-size: clamp(1.45rem, 4.5vw, 1.9rem);
  line-height: 1.25;
  margin: 0 0 0.85rem;
  overflow-wrap: anywhere;
}

.docs-lead {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-left: 4px solid #0d7ea8;
  border-radius: 0 0.65rem 0.65rem 0;
  background: linear-gradient(105deg, #eef8fc 0%, #f6fbfe 55%, #ffffff 100%);
  color: #0a3347;
  font-size: 1.02rem;
  line-height: 1.55;
  box-shadow: 0 1px 0 rgba(13, 126, 168, 0.08);
}

.docs-llms-strip {
  margin: 0 0 1.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid #cfe6f0;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #f0faf7 0%, #eef6fb 100%);
  font-size: 0.92rem;
  line-height: 1.5;
}

.docs-llms-strip strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #003f5d;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-llms-strip a {
  color: #07577c;
  font-weight: 600;
}

.docs-llms-strip a:hover {
  color: #003f5d;
}

.docs-llms-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-llms-links li {
  margin: 0;
}

.docs-article h2 {
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  margin: 1.6rem 0 0.65rem;
  overflow-wrap: anywhere;
}

.docs-article h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}

.docs-article p,
.docs-article li {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.docs-article ul {
  padding-left: 1.2rem;
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.docs-article thead,
.docs-article tbody,
.docs-article tr {
  display: table;
  width: 100%;
  table-layout: auto;
}

.docs-article th,
.docs-article td {
  border: 1px solid #d9e2e8;
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.docs-article th {
  background: #eef6fa;
}

.docs-article code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88em;
}

.docs-article :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: #eef4f7;
  color: #0a3d52;
}

.docs-code {
  position: relative;
  margin: 1rem 0;
}

.docs-code pre {
  margin: 0;
  overflow: auto;
  padding: 2.4rem 0.85rem 0.95rem;
  background: #102a3a;
  color: #fff;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: min(70dvh, 36rem);
  -webkit-overflow-scrolling: touch;
}

.docs-code pre code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.docs-copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.45rem;
  background: rgba(8, 28, 40, 0.72);
  color: #e8f2f7;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.docs-copy-btn:hover,
.docs-copy-btn:focus-visible {
  background: rgba(16, 56, 78, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.docs-copy-btn.is-copied {
  color: #8dffb0;
  border-color: rgba(141, 255, 176, 0.55);
}

.docs-copy-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  pointer-events: none;
}

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #d9e2e8;
}

.docs-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 3.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #d0dde5;
  border-radius: 0.55rem;
  background: #f8fbfc;
  color: #07577c;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.docs-pager-link:hover,
.docs-pager-link:focus-visible {
  border-color: #07577c;
  background: #eef6fa;
  box-shadow: 0 0 0 1px rgba(7, 87, 124, 0.12);
  outline: none;
}

.docs-pager-prev {
  text-align: left;
}

.docs-pager-next {
  text-align: right;
  align-items: flex-end;
}

.docs-pager-dir {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5a6f7a;
}

.docs-pager-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #003f5d;
  overflow-wrap: anywhere;
}

.docs-pager-link.is-disabled {
  visibility: hidden;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.docs-cta {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  background: #eaf5fa;
  border-radius: 0.6rem;
}

.docs-cta p {
  margin: 0.45rem 0 0;
}

.docs-sidebar a.is-gated {
  color: #5a6f7a;
}

.docs-nav-lock {
  margin-left: 0.35rem;
  font-size: 0.85em;
  opacity: 0.9;
}

/* Markdown callouts */
.docs-callout {
  margin: 1.15rem 0;
  padding: 0.95rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  box-shadow: 0 8px 22px rgba(0, 40, 60, 0.06);
}

.docs-callout-title {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.02rem;
}

.docs-callout p {
  margin: 0;
  line-height: 1.5;
}

.docs-callout--info {
  background: linear-gradient(135deg, #e8f6ff 0%, #f3fbff 100%);
  border-color: #9fd0ef;
  color: #064766;
}

.docs-callout--tip {
  background: linear-gradient(135deg, #e9fbf2 0%, #f4fff9 100%);
  border-color: #8ed9b0;
  color: #0b5c38;
}

.docs-callout--warn {
  background: linear-gradient(135deg, #fff6e8 0%, #fffaf2 100%);
  border-color: #f0c48a;
  color: #7a4a08;
}

.docs-callout--success {
  background: linear-gradient(135deg, #eef8ea 0%, #f7fcf5 100%);
  border-color: #a8d48f;
  color: #2f5d1c;
}

.docs-callout--lock {
  background: linear-gradient(135deg, #f3eefe 0%, #faf7ff 100%);
  border-color: #c9b4f0;
  color: #4a2f86;
}

.docs-callout--step {
  background: linear-gradient(135deg, #e8f0ff 0%, #f5f8ff 100%);
  border-color: #9db5ef;
  color: #1e3a6e;
  border-left-width: 4px;
  border-left-color: #3b6fd9;
}

.docs-callout--example {
  background: linear-gradient(135deg, #fff8e7 0%, #fffcf3 100%);
  border-color: #e8c96a;
  color: #5c4810;
  border-style: dashed;
}

.docs-figure {
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f8fafc;
}

.docs-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 720px);
  object-fit: contain;
  background: #0f172a08;
}

.docs-figure figcaption {
  margin: 0;
  padding: 0.65rem 0.9rem 0.8rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #475569;
  border-top: 1px solid #e2e8f0;
}

/* Soft gate when PicoC guides are locked */
.docs-gate {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.5rem;
  padding: 1.6rem 1.35rem 1.4rem;
  border-radius: 1.15rem;
  border: 1px solid #c9b4f0;
  background:
    radial-gradient(circle at top right, rgba(255, 196, 92, 0.35), transparent 42%),
    linear-gradient(145deg, #5b2fd6 0%, #1f8bb8 55%, #0ea5a0 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(40, 30, 110, 0.22);
}

.docs-gate-glow {
  position: absolute;
  inset: auto -20% -40% auto;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(8px);
  pointer-events: none;
}

.docs-gate-badge {
  position: relative;
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-gate-title {
  position: relative;
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  line-height: 1.2;
  color: #fff;
}

.docs-gate-lead {
  position: relative;
  margin: 0.75rem 0 0;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
}

.docs-gate-steps {
  position: relative;
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.docs-gate-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
  font-weight: 600;
}

.docs-gate-step-num {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #ffd56a;
  color: #3d2a00;
  font-size: 0.85rem;
  font-weight: 800;
}

.docs-gate-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.docs-gate-btn.btn-primary {
  background: #ffd56a;
  border-color: #ffd56a;
  color: #2f2200;
}

.docs-gate-btn.btn-primary:hover,
.docs-gate-btn.btn-primary:focus-visible {
  background: #ffe29a;
  border-color: #ffe29a;
  color: #2f2200;
}

.docs-gate-btn.btn-secondary {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.docs-gate-btn.btn-secondary:hover,
.docs-gate-btn.btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.docs-gate-footnote {
  position: relative;
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Overview promo on /docs/loxone */
.docs-access-promo {
  margin: 1.75rem 0 0.5rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid #9fd0ef;
  background:
    linear-gradient(120deg, rgba(255, 213, 106, 0.18), transparent 40%),
    linear-gradient(160deg, #eaf8ff 0%, #f7fffb 100%);
  box-shadow: 0 12px 28px rgba(7, 87, 124, 0.08);
}

.docs-access-promo-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0ea5a0;
}

.docs-access-promo-title {
  margin: 0;
  color: #003f5d;
  font-size: clamp(1.25rem, 2.8vw, 1.55rem);
}

.docs-access-promo-lead {
  margin: 0.55rem 0 0;
  color: #27556c;
  line-height: 1.5;
}

.docs-access-promo-list {
  margin: 0.85rem 0 0;
  padding-left: 1.15rem;
  color: #064766;
  font-weight: 600;
}

.docs-access-promo-list li {
  margin: 0.35rem 0;
}

.docs-access-promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.docs-article mark,
.docs-article strong {
  color: inherit;
}

.docs-article h2 {
  scroll-margin-top: 1rem;
}

/* Desktop: persistent sidebar, no TOC burger */
@media (min-width: 960px) {
  .docs-layout {
    display: grid;
    grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }

  .docs-toc-bar {
    display: none;
  }

  .docs-sidebar,
  .docs-sidebar.is-open {
    display: block;
    position: sticky;
    top: 1rem;
    left: auto;
    right: auto;
    width: auto;
    max-height: calc(100dvh - 2rem);
    box-shadow: none;
  }

  .docs-code pre {
    padding: 2.5rem 1rem 1rem;
    font-size: 0.82rem;
  }

  .docs-gate {
    padding: 1.85rem 1.75rem 1.55rem;
  }
}

@media (max-width: 419px) {
  .docs-sidebar a {
    font-size: 0.95rem;
  }

  .docs-code pre {
    font-size: 0.72rem;
  }

  .docs-gate-actions,
  .docs-access-promo-actions {
    flex-direction: column;
  }

  .docs-gate-btn,
  .docs-access-promo-actions .btn {
    width: 100%;
    text-align: center;
  }
}
