:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-hover: #eef1f5;
  --border: #e2e6eb;
  --border-strong: #cdd3da;
  --text: #1a1f24;
  --text-soft: #5a6470;
  --text-muted: #8b95a1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 6px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-soft);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-muted); }

.bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}
.logo-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  min-height: calc(100vh - 56px);
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .comments { border-left: none !important; border-top: 1px solid var(--border); }
}

/* === Doku === */
.doc {
  background: var(--bg);
  padding: 36px 40px;
}
@media (max-width: 900px) { .doc { padding: 24px 20px; } }

#doc-content {
  max-width: 720px;
}
#doc-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
#doc-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
#doc-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 22px 0 6px;
}
#doc-content p { margin: 0 0 14px; }
#doc-content ul, #doc-content ol { margin: 0 0 14px; padding-left: 22px; }
#doc-content li { margin-bottom: 4px; }
#doc-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}
#doc-content pre {
  background: #1a1f24;
  color: #e6e8eb;
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  margin: 0 0 14px;
}
#doc-content pre code { background: none; border: none; padding: 0; color: inherit; }
#doc-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  margin: 14px 0;
  padding: 10px 14px;
}
#doc-content blockquote p:last-child { margin-bottom: 0; }
#doc-content table {
  border-collapse: collapse;
  margin: 14px 0;
  width: 100%;
}
#doc-content th, #doc-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
#doc-content th { background: var(--bg-soft); font-weight: 600; }
#doc-content img { max-width: 100%; border-radius: var(--radius-sm); }
#doc-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* === Kommentare === */
.comments {
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.comments h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.comment-form {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  transition: background 0.12s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.comment-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.comment-meta strong { color: var(--text); font-weight: 600; }
.comment-body {
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.empty {
  padding: 20px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
