html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.markdown-reader {
  line-height: 1.6;
}

.markdown-reader h1,
.markdown-reader h2,
.markdown-reader h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.markdown-reader h1:first-child,
.markdown-reader h2:first-child,
.markdown-reader h3:first-child {
  margin-top: 0;
}

.markdown-reader pre {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  overflow: auto;
}

.markdown-reader code {
  color: #212529;
}

.markdown-reader blockquote {
  border-left: 0.25rem solid #adb5bd;
  color: #495057;
  margin: 1rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
}

.markdown-reader hr {
  border: 0;
  border-top: 1px solid #adb5bd;
  margin: 1.5rem 0;
  opacity: 1;
}

.markdown-reader img {
  height: auto;
  max-width: 100%;
}

.markdown-reader table {
  margin: 1rem 0;
}

.markdown-reader .task-list {
  list-style: none;
  padding-left: 0;
}

.markdown-reader .mermaid {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin: 1rem 0;
  overflow: auto;
  padding: 1rem;
  text-align: center;
}
/* Native disclosure controls keep the tenant hierarchy keyboard accessible. */
.admin-tree { overflow: auto; }
/* Fit the active tree workspace between the page header and footer. */
html:has(#tree.active) { height: 100%; overflow: hidden; }
body:has(#tree.active) { height: 100dvh; margin-bottom: 0; overflow: hidden; display: flex; flex-direction: column; }
body:has(#tree.active) > header,
body:has(#tree.active) > footer { flex-shrink: 0; }
body:has(#tree.active) > footer { position: static; }
body:has(#tree.active) > .container,
body:has(#tree.active) main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body:has(#tree.active) main > :not(#admin-tab-content) { flex-shrink: 0; }
body:has(#tree.active) #admin-tab-content { flex: 1; min-height: 0; }
body:has(#tree.active) #seed-snippet-panel { display: none; }
#tree.active { height: 100%; min-height: 0; display: flex; flex-direction: column; }
#tree > p { flex-shrink: 0; }
#tree .admin-tree-panels { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: minmax(0, 1fr); gap: 1.5rem; margin: 0; }
#tree .admin-tree-panels > div { width: auto; min-height: 0; min-width: 0; padding: 0; margin: 0; }
#tree .admin-tree, #tree .admin-tree-detail { height: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
@media (max-width: 991.98px) {
  #tree .admin-tree-panels { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
}
@media (max-height: 500px) {
  body:has(#tree.active) > footer { line-height: 32px; }
  body:has(#tree.active) main > h1 { font-size: 1.5rem; }
  #tree > p { font-size: .875rem; margin-bottom: .5rem; }
  #tree .admin-tree, #tree .admin-tree-detail { padding: .5rem !important; }
}
.admin-tree-node .admin-tree-node { margin-left: 1rem; border-left: 1px solid #dee2e6; padding-left: .4rem; }
.admin-tree summary { display: flex; align-items: center; gap: .25rem; padding: .15rem 0; list-style: none; cursor: pointer; }
.admin-tree summary::-webkit-details-marker { display: none; }
.admin-tree summary::before { content: ''; width: .4rem; height: .4rem; margin: 0 .25rem; flex: 0 0 .4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.admin-tree details[open] > summary::before { transform: rotate(45deg); }
.admin-tree-select { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; border: 0; border-radius: .25rem; background: transparent; color: inherit; text-align: left; padding: .3rem .4rem; overflow-wrap: anywhere; }
.admin-tree-select::before { content: ''; flex: 0 0 1.25rem; width: 1.25rem; height: 1.25rem; background: url('../images/tree-document.svg') center / contain no-repeat; }
.admin-tree summary > .admin-tree-select::before { content: none; }
.admin-tree div.admin-tree-node > .admin-tree-select { margin-left: 1.15rem; }
.admin-tree-select:hover { background: #f0f4fa; }
.admin-tree-select[aria-current="true"] { background: #dbeafe; color: #084298; font-weight: 600; }
.admin-tree-select:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }
