/* Documentation engine 2.0 — shared by Workspace Docs tab and the "?" drawer. */

:root {
  --docs-bg: #0b0b0d;
  --docs-panel: #121216;
  --docs-ink: #f4efe6;
  --docs-muted: #b7b0a4;
  --docs-gold: #e8b86d;
  --docs-line: rgba(232, 184, 109, 0.22);
  --docs-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --docs-sans: "Sora", "Avenir Next", "Segoe UI", sans-serif;
}

body.docs-open { overflow: hidden; }

.docs-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}
.docs-drawer[hidden] { display: none !important; }
.docs-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.72);
  backdrop-filter: blur(8px);
}
.docs-drawer-panel {
  position: relative;
  width: min(58rem, 100%);
  height: 100%;
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(232,184,109,.12), transparent 50%),
    linear-gradient(180deg, #121216 0%, #0b0b0d 100%);
  border-left: 1px solid var(--docs-line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  color: var(--docs-ink);
  animation: docs-slide-in .22s ease;
}
@keyframes docs-slide-in {
  from { transform: translateX(16px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}
.docs-drawer-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem 1rem;
  border-bottom: 1px solid var(--docs-line);
}
.docs-drawer-brand {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}
.docs-drawer-mark {
  display: inline-flex;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8b86d, #c4923e);
  color: #1a140c;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 0 24px rgba(232, 184, 109, 0.35);
}
.docs-drawer-h h2 {
  margin: 0;
  font-family: var(--docs-serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.docs-drawer-sum {
  margin: .3rem 0 0;
  color: var(--docs-muted);
  font-size: .9rem;
  line-height: 1.45;
  max-width: 38rem;
}
.docs-reader-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) 1fr;
}
.docs-toc {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .9rem .7rem;
  border-right: 1px solid var(--docs-line);
  overflow: auto;
  background: rgba(8, 8, 10, 0.45);
}
.docs-toc-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .12rem;
  border: 0;
  background: transparent;
  color: var(--docs-muted);
  border-radius: 10px;
  padding: .45rem .6rem;
  font-size: .86rem;
  text-align: left;
  cursor: pointer;
}
.docs-toc-item:hover { background: rgba(232, 184, 109, 0.08); color: var(--docs-ink); }
.docs-toc-item.active {
  background: rgba(232, 184, 109, 0.14);
  color: var(--docs-ink);
  box-shadow: inset 2px 0 0 var(--docs-gold);
}
.docs-toc-kind {
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--docs-gold);
}
.docs-article {
  overflow: auto;
  padding: 1.4rem 1.7rem 2.4rem;
}
.docs-page-h { margin-bottom: 1.15rem; }
.docs-kind {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
  color: var(--docs-gold);
  border: 1px solid var(--docs-line);
  border-radius: 999px;
  padding: .14rem .55rem;
}
.docs-page-h h3 {
  margin: .45rem 0 0;
  font-family: var(--docs-serif);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.docs-lede {
  margin: .55rem 0 0;
  color: var(--docs-muted);
  font-size: 1.02rem;
  line-height: 1.5;
}
.docs-prose {
  color: #e8e2d6;
  line-height: 1.7;
  font-size: 1.02rem;
  max-width: 42rem;
}
.docs-prose h2, .docs-prose h3, .docs-prose h4 {
  font-family: var(--docs-serif);
  color: var(--docs-ink);
  margin: 1.35rem 0 .45rem;
  letter-spacing: -0.02em;
}
.docs-prose p { margin: .55rem 0; }
.docs-prose ul, .docs-prose ol { margin: .45rem 0 1rem 1.2rem; }
.docs-prose li { margin: .28rem 0; }
.docs-prose code {
  background: #1a1a1f;
  border: 1px solid #2a2a32;
  border-radius: 4px;
  padding: .05rem .3rem;
  font-size: .86em;
}
.docs-prose a { color: var(--docs-gold); text-decoration: none; }
.docs-prose a:hover { text-decoration: underline; }
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: .8rem 0 1.1rem;
  font-size: .88rem;
}
.docs-table td, .docs-table th {
  border-bottom: 1px solid #2a2a32;
  padding: .4rem .45rem;
  text-align: left;
}
.docs-callout {
  border-left: 3px solid var(--docs-gold);
  padding: .85rem 1rem .75rem;
  margin: 1rem 0;
  background: rgba(232, 184, 109, 0.08);
  border-radius: 0 12px 12px 0;
}
.docs-callout.warning {
  border-color: #d9886a;
  background: rgba(217, 136, 106, 0.1);
}
.docs-callout.example {
  border-color: #c4b5fd;
  background: rgba(196, 181, 253, 0.08);
}
.docs-callout.note {
  border-color: #7dd3c0;
  background: rgba(125, 211, 192, 0.08);
}
.docs-callout-kicker {
  display: block;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--docs-gold);
  margin-bottom: .25rem;
  font-weight: 700;
}
.docs-callout.warning .docs-callout-kicker { color: #d9886a; }
.docs-callout.example .docs-callout-kicker { color: #c4b5fd; }
.docs-callout.note .docs-callout-kicker { color: #7dd3c0; }
.docs-callout-body p:first-child { margin-top: 0; }
.docs-figure {
  margin: 1.1rem 0;
  padding: .7rem;
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  background: #101014;
}
.docs-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
.docs-figure figcaption {
  margin-top: .5rem;
  color: var(--docs-muted);
  font-size: .82rem;
}
.docs-diagram { background: #0c0c10; }
.docs-figure-fallback { color: var(--docs-muted); font-style: italic; }

.docs-library-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) 1fr;
  gap: 1rem;
  min-height: calc(100vh - 12rem);
}
.docs-library-list {
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  overflow: auto;
  max-height: 74vh;
  background: var(--docs-panel);
}
.docs-library-preview {
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  background:
    radial-gradient(900px 280px at 0% 0%, rgba(232,184,109,.1), transparent 45%),
    linear-gradient(180deg, #121216, #0b0b0d);
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.docs-library-preview .docs-reader-shell { min-height: 28rem; }
.docs-lib-item { width: 100%; text-align: left; }
.docs-lib-kicker {
  display: block;
  font-size: .64rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--docs-gold);
  margin-bottom: .15rem;
}
.docs-lib-preview-h {
  padding: 1.1rem 1.25rem 0;
}
.docs-lib-preview-h h3 {
  margin: 0;
  font-family: var(--docs-serif);
  font-size: 1.5rem;
}

@media (max-width: 900px) {
  .docs-library-layout,
  .docs-reader-shell { grid-template-columns: 1fr; }
  .docs-toc { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--docs-line); }
  .docs-drawer-panel { width: 100%; }
}
