:root {
  --warning: #ff6428;
  --on-warning: #fff;
  --surface: #fff;
  --surface-secondary: #fbfaf9;
  --border-color: #ebe8e4;
  --muted: #a19f9e;
  --content-width: 1180px;
  --solo-width: 760px;
}

/* Dox's persistent application shell and recursive documentation tree are not
   ArtistCSS components. Everything inside the main content area is. */
.dox-shell { min-height: 100vh; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.dox-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px 18px; border-right: 1px solid var(--border-color); background: var(--surface-secondary); z-index: 30; }
.dox-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 45px; }
.dox-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 20px; line-height: 1; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.dox-brand-logo { width: 30px; height: 34px; object-fit: contain; flex: none; }
.dox-sidebar-close, .dox-mobile-header { display: none; }
.dox-search, .dox-search .input { width: auto; }
.dox-search.is-hidden-desktop input { display: block; width: 100%; margin: -35px 0 10px; }
.dox-tree { font-size: 14px; flex: 1; interpolate-size: allow-keywords; }
.dox-tree-folder > summary { display: flex; align-items: center; gap: 4px; min-height: 34px; cursor: pointer; font-weight: 700; list-style: none; padding: 4px 8px; border-radius: 7px; }
.dox-tree-folder > summary::-webkit-details-marker { display: none; }
.dox-tree-folder > summary::before { content: "›"; display: inline-flex; align-items: center; justify-content: center; align-self: center; flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); font-size: 18px; line-height: 16px; text-align: center; transform: translateY(-1px) rotate(0); transform-origin: 50% 50%; transition: transform var(--motion-fast); }
.dox-tree-folder[open] > summary::before { transform: translateY(-1px) rotate(90deg); }
.dox-tree-folder::details-content { block-size: 0; overflow: hidden; transition: block-size var(--motion-medium) var(--motion-ease), content-visibility var(--motion-medium) allow-discrete; }
.dox-tree-folder[open]::details-content { block-size: auto; }
.dox-tree-folder > summary:hover { background: #f0efed; }
.dox-tree-folder > summary > a { min-width: 0; flex: 1; padding: 3px 0; color: var(--ink); text-decoration: none; }
.dox-tree-folder > summary > a:hover { color: var(--ink); text-decoration: none; }
.dox-tree > details.dox-tree-folder:not(:first-child) { margin-top: 20px; }
.dox-tree-children { margin-left: 16px; padding-left: 8px; border-left: 1px solid var(--border-color); }
.dox-tree-document { display: block; padding: 4px 8px; overflow: clip; color: var(--ink); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; border-radius: 7px; }
.dox-tree-document:hover, .dox-tree-document.is-current { background: #f0efed; color: var(--ink); }
.dox-tree-document.dox-tree-heading { margin: 3px 0 -2px; color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: normal; text-transform: capitalize; }
.dox-tree-document.dox-tree-heading:hover, .dox-tree-document.dox-tree-heading.is-current { color: var(--muted); text-decoration: none; }
.dox-tree-document.is-locked { color: var(--muted); cursor: not-allowed; }
.dox-sidebar-footer { display: grid; gap: 7px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); color: var(--muted); font-size: 13px; }
.dox-sidebar-footer a, .dox-link-button { color: var(--ink); font: inherit; text-align: left; text-decoration: underline; border: 0; padding: 0; background: none; cursor: pointer; }
.dox-page { min-width: 0; background: var(--surface); }
.dox-main { padding-top: 27px; padding-bottom: 100px; }
.dox-main .dox-home { margin-top: 80px; }
.dox-document { max-width: var(--solo-width); }
.dox-rich-text { margin-top: 44px; font-size: 18px; line-height: 1.7; }
.dox-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface-secondary); }
.dox-auth-card { width: min(100%, 430px); }
.dox-public-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.dox-public-main { padding-top: 64px; padding-bottom: 100px; }
.dox-public-main .dox-auth-card { margin-inline: auto; }
h1 { margin-bottom: 10px; }
.content h2 { margin-top: 40px; }
.stack > * + * { margin-top: 10px; }
lexxy-editor { --lexxy-editor-rows: 18lh; }

/* Preserve a readable table at the in-between widths where the persistent
   sidebar leaves too little room. ArtistCSS's table container supplies the
   horizontal scroll instead of crushing labels and controls letter-by-letter. */
.dox-folder-access-table { min-width: 920px; }
.dox-folder-access-table :is(th, td):nth-child(1) { min-width: 260px; }
.dox-folder-access-table :is(th, td):nth-child(2) { width: 140px; white-space: nowrap; }
.dox-folder-access-table :is(th, td):nth-child(3) { min-width: 320px; }
.dox-folder-access-table :is(th, td):nth-child(4) { width: 130px; white-space: nowrap; }
.dox-folder-access-table :is(th, td):nth-child(5) { width: 1%; white-space: nowrap; }
.dox-document-list td { vertical-align: middle; }
.dox-document-list td:first-child { width: 100%; padding-left: 0; font-weight: 650; }
.dox-document-list td:last-child { width: 1%; white-space: nowrap; }
.dox-document-list .buttons { flex-wrap: nowrap; }

@media (min-width: 761px) {
  .dox-page-actions { position: fixed; top: 15px; right: 50px; z-index: 5; }
}

@media (max-width: 760px) {
  .dox-shell { display: block; }
  .dox-sidebar { position: fixed; inset: 0 auto 0 0; width: min(90vw, 340px); transform: translateX(-105%); box-shadow: var(--shadow); transition: transform var(--motion-medium) var(--motion-ease); }
  .dox-shell.is-sidebar-open .dox-sidebar { transform: translateX(0); }
  .dox-sidebar-close, .dox-mobile-header { display: flex; }
  .dox-mobile-header { position: sticky; top: 0; z-index: 20; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--border-color); background: rgb(255 255 255 / 92%); backdrop-filter: blur(10px); }
  .dox-main { padding-top: 36px; padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .dox-sidebar, .dox-tree-folder > summary::before, .dox-tree-folder::details-content { transition: none; }
}
