/* Documentation styles for Photon Framework */
:root {
  --doc-sidebar-width: 260px;
  --doc-header-height: 3.5rem;
  --doc-gap: 2rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--pk-text, #1d1d1f);
  background: var(--pk-bg, #ffffff);
  padding-top: var(--doc-header-height);
}

a { color: var(--pk-primary, #5755d9); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== HEADER ===== */
.doc-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--doc-header-height);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}

.theme-dark .doc-header {
  background: rgba(0, 0, 0, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.doc-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pk-text, #1d1d1f);
  text-decoration: none;
}
.doc-header__brand:hover { text-decoration: none; }

.doc-header__logo {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.doc-header__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-header__link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pk-text-secondary, #6e6e73);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.doc-header__link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--pk-text, #1d1d1f);
  text-decoration: none;
}
.doc-header__link svg { width: 18px; height: 18px; }

/* ===== LAYOUT ===== */
.doc-layout {
  display: flex;
  min-height: calc(100vh - var(--doc-header-height));
}

/* ===== SIDEBAR ===== */
.doc-sidebar {
  width: var(--doc-sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--doc-header-height);
  left: 0;
  bottom: 0;
  background: rgba(245, 245, 247, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 0;
  overflow-y: auto;
  z-index: 50;
}

.theme-dark .doc-sidebar {
  background: rgba(30, 30, 30, 0.5);
  border-right-color: rgba(255, 255, 255, 0.06);
}

.doc-sidebar__group { margin-bottom: 0.5rem; }

.doc-sidebar__title {
  display: block;
  padding: 0.35rem 1.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1a6;
}

.doc-sidebar__link {
  display: block;
  padding: 0.35rem 1.25rem;
  font-size: 0.85rem;
  color: #6e6e73;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.doc-sidebar__link:hover {
  background: rgba(87, 85, 217, 0.06);
  color: #1d1d1f;
  text-decoration: none;
}
.doc-sidebar__link.active {
  background: rgba(87, 85, 217, 0.1);
  color: var(--pk-primary, #5755d9);
  border-left-color: var(--pk-primary, #5755d9);
}

.theme-dark .doc-sidebar__link:hover { color: #f5f5f7; }

/* ===== MAIN CONTENT ===== */
.doc-content {
  flex: 1;
  margin-left: var(--doc-sidebar-width);
  padding: 2.5rem 3rem;
  max-width: 960px;
}

.page-logo {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}
.page-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(87, 85, 217, 0.15);
}

.doc-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.doc-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.doc-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.doc-content p { margin-bottom: 0.75rem; color: #6e6e73; }
.doc-content ul, .doc-content ol { margin: 0.5rem 0 0.75rem 1.5rem; color: #6e6e73; }
.doc-content li { margin-bottom: 0.25rem; }

/* ===== COMPONENT DEMO BOX ===== */
.demo-box {
  background: rgba(245, 245, 247, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

.theme-dark .demo-box {
  background: rgba(30, 30, 30, 0.5);
  border-color: rgba(255, 255, 255, 0.06);
}

.demo-box--column { flex-direction: column; }
.demo-box--gap-lg { gap: 1.5rem; }

/* ===== SCROLLBAR (Photon style, doc only) ===== */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}
.theme-dark html {
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}
.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}
.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ===== CODE BLOCKS ===== */
.code-block {
  position: relative;
  margin: 0.5rem 0 1.5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.code-block pre {
  margin: 0;
  padding: 1.25rem 1rem;
  background: #1d1d1f;
  color: #f5f5f7;
  font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  tab-size: 2;
}

.theme-dark .code-block {
  border-color: rgba(255, 255, 255, 0.06);
}

.theme-dark .code-block pre {
  background: #0a0a0a;
}

.code-block__copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.code-block__copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.code-block__copy.copied {
  background: var(--pk-success, #32b643);
  color: #fff;
}

/* Inline code in docs */
.doc-content code:not(pre code) {
  font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
  font-size: 0.8em;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--pk-primary, #5755d9);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.theme-dark .doc-content code:not(pre code) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ===== TABS IN DOCS ===== */
.doc-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.doc-tab {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6e6e73;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.doc-tab:hover { color: #1d1d1f; }
.doc-tab.active {
  color: var(--pk-primary, #5755d9);
  border-bottom-color: var(--pk-primary, #5755d9);
}

/* ===== RESPONSIVE ===== */
.doc-sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.65rem;
  left: 0.75rem;
  z-index: 110;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-size: 1.1rem;
  align-items: center;
  justify-content: center;
  color: var(--pk-text, #1d1d1f);
}
.doc-sidebar-toggle:hover { background: rgba(255, 255, 255, 0.95); }

.doc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 80;
}
.doc-sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
  .doc-sidebar-toggle { display: flex; }

  .doc-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 90;
  }
  .doc-sidebar.open { transform: translateX(0); }

  .doc-content {
    margin-left: 0;
    padding: 1.5rem 1.25rem;
  }

  .doc-content h1 { font-size: 1.7rem; }
  .doc-content h2 { font-size: 1.25rem; }

  .doc-header__link-text { display: none; }
  .doc-header { padding: 0 0.75rem; }

  .demo-box { padding: 1rem; }
}

/* ===== SVG ICON PAGE ===== */
.svg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.svg-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(245, 245, 247, 0.3);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.svg-item:hover {
  background: rgba(87, 85, 217, 0.06);
  border-color: var(--pk-primary, #5755d9);
  transform: translateY(-2px);
}
.svg-item svg { width: 28px; height: 28px; color: var(--pk-text, #1d1d1f); }
.svg-item span { font-size: 0.72rem; color: #6e6e73; text-align: center; }
.svg-item .svg-copied {
  font-size: 0.62rem;
  color: var(--pk-success, #32b643);
  opacity: 0;
  transition: opacity 0.2s;
}
.svg-item .svg-copied.show { opacity: 1; }

.theme-dark .svg-item { background: rgba(30, 30, 30, 0.3); }

/* ===== QUICK START ===== */
.quick-start code {
  font-family: 'SF Mono', monospace;
  font-size: 0.85rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-card {
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(245, 245, 247, 0.3);
}
.feature-card h3 { font-size: 1rem; margin-bottom: 0.3rem; border: none; }
.feature-card p { font-size: 0.85rem; margin: 0; }

.theme-dark .feature-card { background: rgba(30, 30, 30, 0.3); }

/* ===== IMAGE PLACEHOLDERS (doc only) ===== */
.doc-content img {
  background: linear-gradient(135deg, rgba(87,85,217,0.08), rgba(50,182,67,0.08));
  color: #6e6e73;
  font-size: 0.75rem;
  text-align: center;
  position: relative;
}
.theme-dark .doc-content img {
  background: linear-gradient(135deg, rgba(87,85,217,0.12), rgba(50,182,67,0.12));
  color: #a1a1a6;
}
.doc-content img[src$=".jpg"],
.doc-content img[src*="picsum"] {
  min-height: 80px;
}
.doc-content .pk-gallery-item img {
  background: linear-gradient(135deg, #667eea, #764ba2);
  min-height: auto;
}
.doc-content img[src*="photo_2026"] {
  background: none;
  min-height: auto;
}
.doc-content .page-logo img {
  background: none;
}

/* ===== CAROUSEL PLACEHOLDERS (doc only) ===== */
.doc-content .carousel__slide {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-content .carousel__slide[style*="flex-end"] {
  align-items: flex-end;
}
/* ===== PHOTON-TW DEMO STYLES ===== */
.doc-content .pt-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: rgba(245, 245, 247, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0 1.5rem;
}
.theme-dark .pt-demo {
  background: rgba(30, 30, 30, 0.5);
  border-color: rgba(255, 255, 255, 0.06);
}
.pt-demo--col { flex-direction: column; }
.pt-demo--gap-lg { gap: 1.5rem; }
.pt-demo__label {
  font-size: 0.72rem;
  color: #a1a1a6;
  margin-top: 0.25rem;
  text-align: center;
  width: 100%;
}
.pt-demo-box {
  background: rgba(87, 85, 217, 0.06);
  border: 1px solid rgba(87, 85, 217, 0.12);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  min-width: 60px;
}
.theme-dark .pt-demo-box {
  background: rgba(87, 85, 217, 0.12);
  border-color: rgba(87, 85, 217, 0.2);
}

.doc-content .carousel__slide .carousel__placeholder {
  font-size: 2.5rem;
  font-weight: 200;
  letter-spacing: 0.4em;
  opacity: 0.6;
  color: #fff;
  text-align: center;
  user-select: none;
}

/* ===== IMPROVED DEMO CARDS ===== */
.doc-content .demo-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.5));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s, transform 0.3s;
}
.theme-dark .demo-card {
  background: linear-gradient(135deg, rgba(30,30,30,0.9), rgba(30,30,30,0.5));
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ===== CODE BLOCK ENHANCEMENTS ===== */
.code-block {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border-radius: 12px;
}
.code-block pre {
  padding: 1.5rem 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  tab-size: 2;
}
.theme-dark .code-block pre {
  background: linear-gradient(135deg, #0a0a0f, #0f0f1a);
}
.code-block pre code {
  color: #e4e4e7;
}
.code-block pre code .tag { color: #ff79c6; }
.code-block pre code .attr { color: #50fa7b; }
.code-block pre code .string { color: #f1fa8c; }
.code-block pre code .comment { color: #6272a4; font-style: italic; }
.code-block pre code .keyword { color: #ff79c6; }
.code-block pre code .number { color: #bd93f9; }
.code-block::before {
  content: '';
  display: block;
  height: 28px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px 12px 0 0;
  background-image: radial-gradient(circle 6px at 16px 14px, #ff5f56 100%, transparent 0),
                    radial-gradient(circle 6px at 38px 14px, #ffbd2e 100%, transparent 0),
                    radial-gradient(circle 6px at 60px 14px, #27c93f 100%, transparent 0);
  background-size: 80px 28px;
  background-repeat: no-repeat;
}

/* ===== BEAUTIFUL TABLES ===== */
.doc-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
}
.theme-dark .doc-content table {
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.doc-content table thead {
  background: rgba(87,85,217,0.06);
}
.theme-dark .doc-content table thead {
  background: rgba(87,85,217,0.1);
}
.doc-content table th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  color: #6e6e73;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.doc-content table td {
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: #1d1d1f;
}
.theme-dark .doc-content table td {
  color: #e4e4e7;
  border-bottom-color: rgba(255,255,255,0.04);
}
.doc-content table tbody tr:last-child td {
  border-bottom: none;
}
.doc-content table tbody tr:hover {
  background: rgba(87,85,217,0.03);
}
.theme-dark .doc-content table tbody tr:hover {
  background: rgba(87,85,217,0.06);
}

/* ===== CALLOUT / ALERT BOXES ===== */
.doc-callout {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1rem 0 1.5rem;
  border-left: 4px solid var(--pk-primary, #5755d9);
  background: rgba(87,85,217,0.04);
  font-size: 0.9rem;
  color: #1d1d1f;
}
.theme-dark .doc-callout {
  background: rgba(87,85,217,0.08);
  color: #e4e4e7;
}
.doc-callout--success { border-left-color: var(--pk-success, #32b643); background: rgba(50,182,67,0.04); }
.doc-callout--warning { border-left-color: var(--pk-warning, #ffb700); background: rgba(255,183,0,0.04); }
.doc-callout--error { border-left-color: var(--pk-error, #e85600); background: rgba(232,86,0,0.04); }
.doc-callout__icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ===== BETTER PT-DEMO STYLING ===== */
.doc-content .pt-demo {
  background: linear-gradient(135deg, rgba(245,245,247,0.7), rgba(245,245,247,0.3));
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 1.75rem;
  margin: 1.25rem 0 1.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.theme-dark .pt-demo {
  background: linear-gradient(135deg, rgba(30,30,30,0.6), rgba(30,30,30,0.2));
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* ===== DOC CONTENT ENHANCEMENTS ===== */
.doc-content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1d1d1f, #5755d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.theme-dark .doc-content h1 {
  background: linear-gradient(135deg, #f5f5f7, #5755d9);
  -webkit-background-clip: text;
  background-clip: text;
}
.doc-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(87,85,217,0.15);
}
.theme-dark .doc-content h2 {
  border-bottom-color: rgba(87,85,217,0.25);
}
.doc-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--pk-primary, #5755d9);
}
.doc-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.85rem;
  color: #3a3a3c;
}
.theme-dark .doc-content p {
  color: #a1a1a6;
}
.doc-content ul, .doc-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3a3a3c;
}
.theme-dark .doc-content ul, .theme-dark .doc-content ol {
  color: #a1a1a6;
}
.doc-content li { margin-bottom: 0.35rem; }
.doc-content strong {
  color: #1d1d1f;
}
.theme-dark .doc-content strong {
  color: #f5f5f7;
}

/* ===== TAG / BADGE STYLING IN DOCS ===== */
.doc-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(87,85,217,0.1);
  color: var(--pk-primary, #5755d9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== STEPPER / NUMBERED LIST ===== */
.doc-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  margin: 0.5rem 0;
  border-radius: 10px;
  background: rgba(245,245,247,0.3);
  border: 1px solid rgba(0,0,0,0.04);
}
.theme-dark .doc-step {
  background: rgba(30,30,30,0.3);
  border-color: rgba(255,255,255,0.04);
}
.doc-step__number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--pk-primary, #5755d9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.doc-step__content { flex: 1; }
.doc-step__content h4 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.doc-step__content p { margin: 0; font-size: 0.85rem; }

/* ===== COMPARISON TABLE ===== */
.doc-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.doc-compare__col {
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(245,245,247,0.4);
}
.theme-dark .doc-compare__col {
  background: rgba(30,30,30,0.4);
  border-color: rgba(255,255,255,0.06);
}
.doc-compare__col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6e6e73;
}
.doc-compare__col--good { border-left: 3px solid var(--pk-success, #32b643); }
.doc-compare__col--bad { border-left: 3px solid var(--pk-error, #e85600); }

/* ===== BEAUTIFUL GRID NAV ===== */
.doc-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.doc-nav-grid a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(245,245,247,0.4);
  text-decoration: none;
  color: #1d1d1f;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-dark .doc-nav-grid a {
  background: rgba(30,30,30,0.4);
  border-color: rgba(255,255,255,0.06);
  color: #e4e4e7;
}
.doc-nav-grid a:hover {
  background: var(--pk-primary, #5755d9);
  color: #fff;
  border-color: var(--pk-primary, #5755d9);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(87,85,217,0.25);
  text-decoration: none;
}
.doc-nav-grid a .nav-icon {
  font-size: 1.2rem;
  width: 1.5rem;
  text-align: center;
}

/* ===== PARAMETER TABLE STYLING ===== */
.doc-param-table { font-size: 0.88rem; }
.doc-param-table td:first-child {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--pk-primary, #5755d9);
}
.doc-param-table td:nth-child(2) {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #6e6e73;
}

/* ===== LAYOUT SAFEGUARDS (override Tailwind preflight) ===== */
.doc-layout { display: flex !important; }
.doc-sidebar { position: fixed !important; width: var(--doc-sidebar-width) !important; flex-shrink: 0 !important; }
.doc-content { flex: 1 !important; margin-left: var(--doc-sidebar-width) !important; max-width: 960px !important; }
.doc-header { position: fixed !important; }
.doc-content .pt-demo { display: flex !important; }
.doc-content .pt-demo--col { flex-direction: column !important; }
.doc-sidebar-toggle { display: none !important; }
@media (max-width: 768px) {
  .doc-sidebar-toggle { display: flex !important; }
  .doc-content { margin-left: 0 !important; }
}

/* ===== SIDEBAR SEARCH ===== */
.sidebar-search {
  padding: 0.5rem 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 0.5rem;
  position: relative;
}
.theme-dark .sidebar-search {
  border-bottom-color: rgba(255,255,255,0.06);
}
.sidebar-search__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-family: inherit;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.6);
  color: #1d1d1f;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.theme-dark .sidebar-search__input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: #e4e4e7;
}
.sidebar-search__input:focus {
  border-color: var(--pk-primary, #5755d9);
  box-shadow: 0 0 0 2px rgba(87,85,217,0.15);
}
.sidebar-search__input::placeholder {
  color: #a1a1a6;
}
.sidebar-search__results {
  display: none;
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  top: calc(100% - 0.25rem);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 60;
}
.theme-dark .sidebar-search__results {
  background: #2d2d2d;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.sidebar-search__item {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: #3a3a3c;
  transition: background 0.15s;
}
.theme-dark .sidebar-search__item {
  color: #c0c0c5;
  border-bottom-color: rgba(255,255,255,0.04);
}
.sidebar-search__item:hover {
  background: rgba(87,85,217,0.06);
}
.theme-dark .sidebar-search__item:hover {
  background: rgba(87,85,217,0.12);
}
.sidebar-search__item:last-child {
  border-bottom: none;
}
.sidebar-search__item strong {
  color: var(--pk-primary, #5755d9);
}
.sidebar-search__item--link {
  display: block;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.theme-dark .sidebar-search__item--link {
  border-bottom-color: rgba(255,255,255,0.04);
}
.sidebar-search__page {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1d1d1f;
  margin-bottom: 0.1rem;
}
.theme-dark .sidebar-search__page {
  color: #e4e4e7;
}
.sidebar-search__sub {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: #8e8e93;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-dark .sidebar-search__sub {
  color: #6e6e73;
}
.sidebar-search__empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: #a1a1a6;
}
.sidebar-search__tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a1a1a6;
  background: rgba(0,0,0,0.04);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.theme-dark .sidebar-search__tag {
  background: rgba(255,255,255,0.06);
  color: #6e6e73;
}
