/* PBLISH static documentation: no build step. Client-side filter runs on search.html only. */

:root {
  --orange: #f26a20;
  --orange-soft: #fff0e8;
  --orange-bar: #fddcc8;
  --bg: #fafaf9;
  --card: #ffffff;
  --text: #171717;
  --muted: #737373;
  --border: #e5e5e5;
  --sidebar: #fafafa;
  --sidebar-border: #e5e5e5;
  --blue: #3b82f6;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #eab308;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body.docs {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3.5rem;
  padding: 0 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.doc-topbar a.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
}

.doc-topbar a.brand img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  object-fit: cover;
}

.doc-topbar .muted {
  color: var(--muted);
  font-size: 0.875rem;
}
@media (max-width: 639px) {
  .hidden-mobile {
    display: none !important;
  }
}

.doc-topbar .spacer {
  flex: 1;
}

.doc-topbar .doc-topbar-search {
  display: flex;
  align-items: center;
  margin: 0;
  flex-shrink: 1;
  min-width: 0;
}

.doc-topbar-search-input {
  width: 9rem;
  max-width: 32vw;
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #f5f5f5;
  color: var(--text);
}

.doc-topbar-search-input:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
  background: #fff;
}

@media (min-width: 768px) {
  .doc-topbar-search-input {
    width: 12rem;
    max-width: 14rem;
  }
}

.doc-topbar a.search-docs {
  display: none;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: #f5f5f5;
}

.doc-topbar a.search-docs[aria-current="page"] {
  color: var(--orange);
  border-color: var(--orange-bar);
  background: var(--orange-soft);
}

@media (min-width: 768px) {
  .doc-topbar a.search-docs {
    display: inline-block;
  }
}

.doc-topbar a.btn-app {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--orange);
  text-decoration: none;
}
.doc-topbar a.btn-app:hover {
  opacity: 0.92;
}

.nav-toggle-label {
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  user-select: none;
}
@media (min-width: 1024px) {
  .nav-toggle-label {
    display: none;
  }
}

.doc-layout {
  display: flex;
  min-height: calc(100vh - 3.5rem);
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.doc-sidebar {
  position: fixed;
  top: 3.5rem;
  left: 0;
  z-index: 40;
  width: 16rem;
  height: calc(100vh - 3.5rem);
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  padding: 1rem;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.nav-toggle:checked ~ .doc-sidebar {
  transform: translateX(0);
}
@media (min-width: 1024px) {
  .doc-sidebar {
    position: sticky;
    transform: none;
  }
}

.doc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 3.5rem;
  background: rgba(0, 0, 0, 0.35);
  z-index: 35;
}
.nav-toggle:checked ~ .doc-sidebar-overlay {
  display: block;
}
@media (min-width: 1024px) {
  .nav-toggle:checked ~ .doc-sidebar-overlay {
    display: none;
  }
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1rem 0 0.35rem 0.5rem;
}
.nav-section-title:first-child {
  margin-top: 0;
}

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

.doc-sidebar a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}
.doc-sidebar a:hover {
  color: var(--text);
  background: #f5f5f5;
}
.doc-sidebar a[aria-current="page"] {
  font-weight: 600;
  color: var(--orange);
  background: var(--orange-soft);
  box-shadow: inset 3px 0 0 var(--orange);
}

.doc-main {
  flex: 1;
  min-width: 0;
  padding-bottom: 2rem;
}
@media (min-width: 1024px) {
  .doc-main {
    margin-left: 0;
  }
}

article.doc-article {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.home-hero {
  background: linear-gradient(135deg, #fff8f4 0%, #fafaf9 60%, #f0f4ff 100%);
  padding: 4rem 1.5rem;
  text-align: center;
}
.home-hero-inner {
  max-width: 56rem;
  margin: 0 auto;
}
.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: var(--orange-soft);
  color: var(--orange);
  margin-bottom: 1.25rem;
}
.home-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 1rem;
  line-height: 1.15;
}
.home-hero .lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 2rem;
  align-items: center;
}
.pill {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--orange);
  text-decoration: none;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  text-decoration: none;
}

.home-section {
  max-width: 56rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.home-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  margin: 0 0 1.5rem;
}
.home-section h2::before {
  content: "";
  width: 4px;
  height: 1.25rem;
  border-radius: 2px;
  background: var(--orange);
}
.step-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .step-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
}
.step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--orange);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.step-card h3 {
  font-size: 0.875rem;
  margin: 0 0 0.25rem;
}
.step-card p {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.doc-card-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.doc-card-link:hover {
  border-color: rgba(242, 106, 32, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.doc-card-link h3 {
  font-size: 0.875rem;
  margin: 0 0 0.35rem;
}
.doc-card-link p {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.doc-card-link .read-more {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--orange);
}
.badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.icon-box {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--orange-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--text);
}
.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header .page-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--orange-soft);
  color: var(--orange);
  margin-bottom: 0.75rem;
}
.page-header h1 {
  font-size: 1.875rem;
  margin: 0 0 0.75rem;
}
.page-header .desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 42rem;
  margin: 0;
}

h2.doc-h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
h3.doc-h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.75rem;
  scroll-margin-top: 5rem;
}

.prose {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}
.prose p {
  margin: 0 0 1rem;
}
.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.prose li {
  margin-bottom: 0.35rem;
}
.prose strong {
  color: var(--text);
}
.prose a {
  color: var(--orange);
}
.prose code,
code.inline {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: #f3f4f6;
  color: #1f2937;
}

.figure {
  margin: 1.5rem 0;
}
.figure-inner {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
}
.figure figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin-top: 0.5rem;
}

.callout {
  margin: 1.25rem 0;
  padding: 0.875rem 1rem;
  border-radius: 0 0.375rem 0.375rem 0;
  border-left: 3px solid;
  font-size: 0.8125rem;
}
.callout-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.callout-body {
  color: var(--muted);
  line-height: 1.55;
}
.callout-tip {
  border-left-color: var(--orange);
  background: #fff8f4;
}
.callout-info {
  border-left-color: var(--blue);
  background: #eff6ff;
}
.callout-warn {
  border-left-color: var(--yellow);
  background: #fefce8;
}
.callout-danger {
  border-left-color: var(--red);
  background: #fef2f2;
}

.table-wrap {
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.doc-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f5f5f5;
  font-weight: 600;
}
table.doc-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
table.doc-table td strong,
table.doc-table td .td-strong {
  color: var(--text);
  font-weight: 500;
}
.text-green {
  color: var(--green);
  font-weight: 500;
}
.text-red {
  color: var(--red);
}
.text-yellow {
  color: #ca8a04;
}

.platform-badge {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0.1rem;
}
.pb-fb {
  background: #ebf5ff;
  color: #1877f2;
}
.pb-ig {
  background: #fdf2f8;
  color: #e1306c;
}
.pb-tt {
  background: #f0fdf4;
  color: #010101;
}
.pb-sc {
  background: #fefce8;
  color: #7a6c00;
}
.pb-ga {
  background: #fef2f2;
  color: #ea4335;
}

.doc-nav-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.doc-nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
@media (min-width: 640px) {
  .doc-nav-grid {
    grid-template-columns: 1fr 1fr;
  }
}
a.doc-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--text);
}
a.doc-nav:hover {
  border-color: rgba(242, 106, 32, 0.35);
  background: #fafafa;
}
a.doc-nav .sub {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
a.doc-nav.next {
  flex-direction: row-reverse;
  text-align: right;
}

.status-row {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}
.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
  height: fit-content;
}

.step-box-list .step-box,
article.doc-article > .step-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  margin-bottom: 1rem;
}
.step-box-num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.issue-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}
.issue-card-head {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.issue-card-head.red {
  background: #fef2f2;
  color: #b91c1c;
  border-bottom: 1px solid var(--border);
}
.issue-card-head.yellow {
  background: #fefce8;
  color: #a16207;
  border-bottom: 1px solid var(--border);
}
.issue-card-body {
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  background: #111827;
  color: #fff;
  padding: 4rem 1.5rem;
  margin-top: auto;
}
.site-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.site-footer h3 {
  font-size: 1.125rem;
  margin: 0 0 1.5rem;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li {
  margin-bottom: 0.75rem;
}
.site-footer a {
  color: #9ca3af;
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
}
.site-footer .brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.site-footer .brand-row img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
}
.site-footer .tagline {
  color: #9ca3af;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.social-row {
  display: flex;
  gap: 1rem;
}
.social-row a {
  color: #9ca3af;
}
.social-row a:hover {
  color: var(--orange);
}
.social-row svg {
  width: 1.25rem;
  height: 1.25rem;
}
.footer-bottom {
  border-top: 1px solid #1f2937;
  margin-top: 3rem;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  font-size: 0.875rem;
  color: #9ca3af;
}
@media (min-width: 1024px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}
@media (min-width: 1024px) {
  .footer-legal {
    justify-content: flex-end;
  }
}

.search-page h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.doc-search-bar {
  margin-bottom: 0.25rem;
}

.doc-search-bar label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.doc-search-input {
  width: 100%;
  max-width: 32rem;
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.doc-search-input:focus {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-color: var(--orange);
}

.doc-search-status {
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.doc-search-status.doc-search-empty {
  color: var(--red);
}

.search-page .hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.search-index {
  columns: 1;
  column-gap: 2rem;
}
@media (min-width: 640px) {
  .search-index {
    columns: 2;
  }
}
.search-index section {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}
.search-index h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--orange);
}
.search-index ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.875rem;
}
.search-index a {
  color: var(--text);
}
.search-index a:hover {
  color: var(--orange);
}

.mapping-table code {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: var(--orange-soft);
  color: var(--orange);
}

.font-mono {
  font-family: var(--mono);
}
