/* Rundplan — documentation page and the plain pages (imprint, privacy).
   Loaded after styles.css; the chrome (header, pills, outro) comes from there. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Page head ─────────────────────────────────────────────────────────── */
.docs-main { padding-top: clamp(28px, 4vw, 48px); }
.docs-head h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); }
.docs-head p { margin-top: 10px; font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* ── Two columns: a sticky contents rail, the prose ────────────────────── */
.docs-grid {
  display: grid;
  grid-template-columns: minmax(220px, 268px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(28px, 4vw, 44px);
  align-items: start;
}
.docs-side { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; }
.docs-toc summary {
  list-style: none; cursor: default;
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  padding: 4px 0 10px;
}
.docs-toc summary::-webkit-details-marker { display: none; }
.docs-toc nav ul { margin: 0; padding: 0; list-style: none; }
.docs-toc nav > ul > li { margin: 2px 0; }
.docs-toc nav a {
  display: block; padding: 6px 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 0.95rem; line-height: 1.35;
}
.docs-toc nav a:hover { background: var(--sky-50); color: var(--sky-800); }
.docs-toc nav > ul > li > a { font-weight: 600; }
.docs-toc nav ul ul { margin: 0 0 6px 10px; border-left: 1.5px solid var(--sky-100); }
.docs-toc nav ul ul a { font-size: 0.9rem; padding: 4px 10px; color: var(--muted); }

.docs-filter { position: relative; margin: 0 0 12px; }
.docs-filter input {
  width: 100%; min-height: 42px; padding: 0 36px 0 14px;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  border: 1px solid var(--rim); border-radius: 999px; background: var(--white);
  box-shadow: var(--inset);
}
.docs-filter input:focus { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.docs-filter-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 999px; border: 0; background: var(--sky-50); color: var(--sky-800);
  font: inherit; font-size: 1.1rem; cursor: pointer;
}
.docs-nomatch { margin-top: 8px; font-size: 0.9rem; color: var(--muted); }

/* ── The AI tip ─────────────────────────────────────────────────────────── */
.ai-tip {
  padding: 22px 24px 24px;
  border-radius: 20px; border: 1px solid var(--sky-100);
  background: linear-gradient(135deg, var(--sky-50), #ffffff 70%);
  box-shadow: var(--raised-soft);
}
.ai-tip-head { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.ai-tip-head svg { width: 34px; height: 34px; fill: none; stroke: var(--sky-500); stroke-width: 1.8; stroke-linejoin: round; }
.ai-tip h2 { font-size: 1.2rem; }
.ai-tip-head p { margin-top: 6px; color: var(--muted); }
.ai-tip-prompt { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.ai-tip-prompt pre {
  margin: 0; padding: 14px 16px; overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere;
  font: 0.92rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--ink); background: var(--white); border: 1px solid var(--rim); border-radius: 14px;
}
.pill-copy { align-self: center; min-width: 96px; }
.pill-copy.is-done { background: var(--green); color: var(--white); border-color: var(--green); }

/* ── Prose ──────────────────────────────────────────────────────────────── */
.docs-prose { margin-top: clamp(32px, 4vw, 48px); }
.docs-prose .doc-section { padding: 8px 0 32px; border-top: 1px solid var(--sky-100); margin-top: 32px; scroll-margin-top: calc(var(--header-h) + 16px); }
.docs-prose .doc-section:first-child { border-top: 0; margin-top: 0; }
.docs-prose h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); margin-top: 20px; }
.docs-prose h3 { font-size: 1.25rem; margin-top: 32px; }
.docs-prose h4 { font-size: 1.05rem; margin: 24px 0 0; color: var(--ink); }
.docs-prose h2, .docs-prose h3, .docs-prose h4 { scroll-margin-top: calc(var(--header-h) + 16px); position: relative; }
.docs-prose .anchor {
  margin-left: 8px; font-weight: 400; color: var(--sky-300); text-decoration: none; opacity: 0;
}
.docs-prose h2:hover .anchor, .docs-prose h3:hover .anchor, .docs-prose h4:hover .anchor, .docs-prose .anchor:focus { opacity: 1; }
.docs-prose p { margin-top: 12px; max-width: 72ch; text-wrap: pretty; }
.docs-prose ul, .docs-prose ol { margin: 12px 0 0; padding-left: 1.5em; max-width: 72ch; }
.docs-prose ul { list-style: disc; }
.docs-prose ol { list-style: decimal; }
.docs-prose li { margin: 6px 0; }
.docs-prose li > ul, .docs-prose li > ol { margin-top: 6px; }
.docs-prose strong { font-weight: 650; color: var(--ink); }
.docs-prose code {
  font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  padding: 1px 6px; border-radius: 6px; background: var(--sky-50); color: var(--sky-900);
}
.docs-prose pre { margin: 14px 0 0; padding: 14px 16px; overflow: auto; border-radius: 14px; background: var(--ink); color: #e2e8f0; max-width: 100%; }
.docs-prose pre code { padding: 0; background: none; color: inherit; font-size: 0.9rem; }
.docs-prose blockquote {
  margin: 16px 0 0; padding: 12px 18px; max-width: 72ch;
  border-left: 4px solid var(--sky-400); border-radius: 0 14px 14px 0; background: var(--sky-50); color: var(--text);
}
.docs-prose blockquote p { margin-top: 6px; }
.docs-prose blockquote p:first-child { margin-top: 0; }
.docs-prose .callout { border-left-color: var(--sky-500); }
.docs-prose .callout-warning { border-left-color: var(--warm); background: #fff4f1; }
.docs-prose hr { margin: 28px 0 0; border: 0; border-top: 1px solid var(--sky-100); }
.docs-prose .table-wrap { margin-top: 14px; overflow-x: auto; max-width: 100%; }
.docs-body, .docs-side { min-width: 0; }
.docs-prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.docs-prose th, .docs-prose td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--sky-100); }
.docs-prose th { font-weight: 650; color: var(--ink); background: var(--sky-50); }
.docs-prose img { max-width: 100%; height: auto; border-radius: 12px; }
.docs-prose a { color: var(--sky-700); text-underline-offset: 3px; }
.docs-empty { color: var(--muted); font-size: 1.1rem; }

/* ── Plain pages ─────────────────────────────────────────────────────────── */
.plain-main { padding-top: clamp(28px, 4vw, 48px); min-height: 40vh; }
.plain-body p { margin-top: 14px; max-width: 64ch; }
.legal-body { max-width: 76ch; padding-bottom: clamp(32px, 5vw, 64px); }
.legal-body h1 { margin-bottom: 8px; }
.legal-body h2 { font-size: 1.35rem; margin-top: 36px; }
.legal-body h2:first-of-type { margin-top: 24px; }
.legal-body hr { border: 0; border-top: 1px solid var(--rim); margin: 36px 0 0; }
.legal-body hr + p { color: var(--muted); font-size: 0.95rem; }
.legal-back { margin-top: 32px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .docs-grid > * { min-width: 0; }
  .docs-side { position: relative; top: auto; max-height: none; overflow: visible; }
  .docs-toc { border: 1px solid var(--rim); border-radius: 18px; padding: 10px 16px 12px; box-shadow: var(--raised-soft); background: var(--white); }
  .docs-toc summary { cursor: pointer; padding: 6px 0; }
  .docs-toc summary::after { content: "▾"; float: right; }
  .docs-toc[open] summary::after { content: "▴"; }
  .ai-tip-prompt { grid-template-columns: 1fr; }
}
