:root {
  --bg: #f7f8fc;
  --bg2: #ffffff;
  --bg3: #f0f2f8;
  --border: #e2e6f0;
  --text: #1a2035;
  --text-dim: #4f5a76;      /* 6,8:1 na bílé */
  --text-dimmer: #5f6b86;   /* 5,4:1 na bílé, 4,7:1 na --bg3 */
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --green-mid: #dcfce7;
  --yellow: #d97706;
  --yellow-light: #fffbeb;
  --red: #dc2626;
  --red-light: #fef2f2;
  --green-text: #15803d;
  --yellow-text: #b45309;
  --red-text: #b91c1c;
  --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}

/* NAV */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.logo { font-size: 1.2rem; font-weight: 800; color: var(--accent); text-decoration: none; }
.logo span { color: var(--text-dimmer); font-weight: 400; }
.nav-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-dim); text-decoration: none;
  font-size: 0.88rem; font-weight: 600; transition: color 0.2s;
}
.nav-back:hover { color: var(--accent); }

/* LAYOUT */
.layout {
  max-width: 1060px; margin: 0 auto; padding: 0 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* SIDEBAR */
.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-dimmer); margin-bottom: 12px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-nav a {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--text-dim); text-decoration: none;
  font-size: 0.875rem; font-weight: 600; transition: all 0.15s;
}

.sidebar-nav a:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav a.active { background: var(--accent-light); color: var(--accent); }

.sidebar-nav .sub {
  padding-left: 20px; font-size: 0.82rem; font-weight: 500;
}

/* CONTENT */
.content { min-width: 0; }

.page-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.page-desc {
  color: var(--text-dim); font-size: 1rem;
  margin-bottom: 48px; max-width: 600px;
}

/* SECTIONS */
.doc-section { margin-bottom: 56px; scroll-margin-top: 80px; }

.doc-section h2 {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 6px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.doc-section h3 {
  font-size: 1rem; font-weight: 700;
  margin: 24px 0 10px;
  display: flex; align-items: center; gap: 8px;
}

.doc-section p {
  color: var(--text-dim); margin-bottom: 14px; font-size: 0.95rem;
}

.doc-section p strong { color: var(--text); }

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge.get    { background: var(--accent-light); color: var(--accent); }
.badge.sub    { background: var(--green-light); color: var(--green-text); }
.badge.block  { background: var(--red-light); color: var(--red-text); }
.badge.note   { background: var(--yellow-light); color: var(--yellow-text); }

/* CODE */
.code {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin: 16px 0;
}

.code-header {
  background: var(--bg3); border-bottom: 1px solid var(--border);
  padding: 8px 16px; font-size: 0.72rem; font-weight: 700;
  color: var(--text-dimmer); text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: space-between;
}

.code pre {
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 0.82rem; line-height: 1.75;
  color: var(--text); overflow-x: auto;
}

.kw  { color: #7c3aed; font-weight: 600; }
.fn  { color: #1d4ed8; }
.str { color: #15803d; }
.num { color: #b45309; }
.key { color: #1d4ed8; }
.cmt { color: var(--text-dimmer); font-style: italic; }

/* INLINE CODE */
code {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 6px;
  font-family: var(--mono); font-size: 0.85em;
  color: var(--accent);
}

/* TABLE */
.table-wrap {
  overflow-x: auto; margin: 16px 0;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

table {
  width: 100%; border-collapse: collapse;
  background: var(--bg2); font-size: 0.875rem;
}

thead tr { background: var(--bg3); }

th {
  padding: 12px 16px; text-align: left;
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-dimmer); border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px; border-bottom: 1px solid var(--bg3);
  color: var(--text-dim); vertical-align: top;
}

td:first-child { font-family: var(--mono); color: var(--text); font-size: 0.82rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ALERT BOXES */
.alert {
  border-radius: var(--radius); padding: 14px 18px;
  margin: 16px 0; font-size: 0.9rem; line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.alert.info    { background: var(--accent-light); border-left: 3px solid var(--accent); }
.alert.warning { background: var(--yellow-light); border-left: 3px solid var(--yellow); }
.alert.success { background: var(--green-light);  border-left: 3px solid var(--green); }
.alert.error   { background: var(--red-light);    border-left: 3px solid var(--red); }
.alert-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert.info .alert-icon    { color: var(--accent); }
.alert.warning .alert-icon { color: var(--yellow-text); }
.alert.success .alert-icon { color: var(--green-text); }
.alert.error .alert-icon   { color: var(--red-text); }
.alert p { color: var(--text); margin: 0; }
.alert p strong { color: var(--text); }

/* ENDPOINT ROW */
.endpoint-row {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  margin: 12px 0; box-shadow: var(--shadow);
}
.endpoint-row .ep-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.endpoint-row .ep-url {
  font-family: var(--mono); font-size: 0.9rem;
  font-weight: 700; color: var(--text);
}
.endpoint-row .ep-desc {
  font-size: 0.875rem; color: var(--text-dim); margin: 0;
}
.endpoint-row .ep-note {
  font-size: 0.78rem; color: var(--text-dimmer);
  margin-top: 6px; font-weight: 600;
}

/* FOOTER */
footer {
  background: var(--bg2); border-top: 1px solid var(--border); padding: 32px 0;
}
.footer-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-logo { font-size: 1rem; font-weight: 800; color: var(--accent); }
.footer-text { font-size: 0.8rem; color: var(--text-dimmer); }
.footer-text a { color: var(--text-dim); text-decoration: none; font-weight: 600; }
.footer-text a:hover { color: var(--accent); }

/* Dříve inline styly (kvůli CSP bez 'unsafe-inline') */
.link { color: var(--accent); font-weight: 600; }
.small { font-size: 0.82rem; }
.doc-section h3.mt-lg { margin-top: 28px; }
td, .ep-url, code { font-variant-numeric: tabular-nums; }
