.docs-page {
  background: var(--bg);
}

.docs-header-actions {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.docs-header-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.docs-header-label i {
  color: var(--brand);
  margin-right: 0.35rem;
}

.docs-hero {
  background:
    linear-gradient(180deg, rgba(4, 10, 19, 0.1), var(--bg)),
    radial-gradient(circle at 80% 22%, rgba(56, 189, 248, 0.1), transparent 30%),
    var(--bg-deep);
  overflow: hidden;
  padding: calc(var(--header-height) + 4.5rem) 0 3rem;
  position: relative;
}

.docs-orb {
  border-radius: 50%;
  pointer-events: none;
  position: absolute;
}

.docs-orb-one {
  background: radial-gradient(circle, rgba(255, 138, 52, 0.26), transparent 70%);
  height: 30rem;
  left: -17rem;
  top: -8rem;
  width: 30rem;
}

.docs-orb-two {
  background: radial-gradient(circle, rgba(167, 139, 250, 0.2), transparent 70%);
  bottom: -18rem;
  height: 34rem;
  right: -18rem;
  width: 34rem;
}

.docs-breadcrumb {
  font-size: 0.78rem;
  margin-bottom: 2rem;
}

.docs-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--brand);
}

.docs-breadcrumb .active {
  color: var(--muted-strong);
}

.docs-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--border-strong);
}

.docs-hero h1 {
  font-size: clamp(2.7rem, 6.5vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.98;
  margin: 1.25rem 0 1.35rem;
  max-width: 12ch;
}

.docs-hero .col-lg-8 > p {
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  max-width: 43rem;
}

.docs-trust-card {
  align-items: center;
  background: rgba(18, 34, 56, 0.76);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  gap: 0.95rem;
  padding: 1.2rem;
}

.trust-card-icon {
  align-items: center;
  background: rgba(53, 208, 127, 0.12);
  border-radius: 0.85rem;
  color: var(--green);
  display: flex;
  flex: 0 0 auto;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

.docs-trust-card strong,
.docs-trust-card small {
  display: block;
}

.docs-trust-card strong {
  font-size: 0.9rem;
}

.docs-trust-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-top: 0.2rem;
}

.docs-stats {
  background: rgba(13, 27, 42, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 3.5rem;
  overflow: hidden;
}

.docs-stats > div {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-height: 5.25rem;
  padding: 1rem 1.2rem;
}

.docs-stats > div + div {
  border-left: 1px solid var(--border);
}

.docs-stats strong {
  color: var(--brand);
  font-size: 1.75rem;
  letter-spacing: -0.05em;
}

.docs-stats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.docs-catalog {
  padding: clamp(4.5rem, 8vw, 7rem) 0;
}

.catalog-heading {
  align-items: end;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(16rem, 0.7fr);
  margin-bottom: 2.5rem;
}

.catalog-heading h2 {
  font-size: clamp(2.1rem, 4.8vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.05;
  margin: 1rem 0 0;
}

.catalog-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

.catalog-toolbar {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 1.25rem;
}

.document-search label {
  color: var(--muted-strong);
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.search-control {
  align-items: center;
  background: var(--bg-deep);
  border: 1px solid var(--control-border);
  border-radius: 0.9rem;
  display: flex;
  min-height: 3.25rem;
  padding: 0 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-control:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.12);
}

.search-control > i {
  color: var(--muted);
}

.search-control input {
  background: transparent;
  border: 0;
  color: var(--text);
  flex: 1;
  min-width: 0;
  outline: 0;
  padding: 0.75rem;
}

.search-control input::placeholder {
  color: #728198;
}

.search-control button {
  align-items: center;
  background: var(--surface-raised);
  border: 0;
  border-radius: 0.55rem;
  color: var(--muted);
  display: flex;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.catalog-result {
  align-items: center;
  border-left: 1px solid var(--border);
  display: flex;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0 0.65rem 0 1.25rem;
}

.catalog-result strong {
  color: var(--brand);
  font-size: 1.65rem;
}

.catalog-result span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.25;
  max-width: 4.5rem;
}

.document-filters {
  display: flex;
  gap: 0.5rem;
  margin: 1.1rem 0 2.2rem;
  overflow-x: auto;
  padding: 0.2rem 0.15rem 0.7rem;
}

.document-filter {
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: 0.75rem;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 800;
  min-height: 2.65rem;
  padding: 0.5rem 0.75rem;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.document-filter span {
  background: rgba(255, 255, 255, 0.065);
  border-radius: 999px;
  display: inline-block;
  font-size: 0.75rem;
  margin-left: 0.3rem;
  min-width: 1.35rem;
  padding: 0.08rem 0.3rem;
}

.document-filter:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.document-filter.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #111827;
}

.document-filter.active span {
  background: rgba(17, 24, 39, 0.13);
}

.document-groups {
  display: grid;
  gap: 1rem;
}

.document-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.document-group[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.document-group > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  list-style: none;
  min-height: 6.2rem;
  padding: 1.15rem 1.25rem;
  user-select: none;
}

.document-group > summary::-webkit-details-marker {
  display: none;
}

.document-group > summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.group-icon {
  align-items: center;
  border-radius: 0.9rem;
  display: flex;
  font-size: 1.1rem;
  height: 3.2rem;
  justify-content: center;
  width: 3.2rem;
}

.group-copy strong,
.group-copy small {
  display: block;
}

.group-copy strong {
  font-size: 1rem;
  font-weight: 800;
}

.group-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.2rem;
}

.group-count {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
}

.group-chevron {
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform var(--transition);
}

.document-group[open] .group-chevron {
  transform: rotate(180deg);
}

.document-list {
  border-top: 1px solid var(--border);
  list-style: none;
  margin: 0;
  padding: 0 1.25rem;
}

.document-row {
  align-items: center;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  min-height: 5rem;
  padding: 0.9rem 0;
}

.document-row + .document-row {
  border-top: 1px solid rgba(35, 56, 82, 0.72);
}

.document-row[hidden],
.document-group[hidden] {
  display: none;
}

.document-icon {
  align-items: center;
  background: rgba(251, 113, 133, 0.11);
  border-radius: 0.7rem;
  color: var(--pink);
  display: flex;
  height: 2.55rem;
  justify-content: center;
  width: 2.55rem;
}

.document-copy strong,
.document-copy small {
  display: block;
}

.document-copy strong {
  font-size: 0.86rem;
  font-weight: 800;
}

.document-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.document-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 0.35rem;
  padding: 0.33rem 0.6rem;
  white-space: nowrap;
}

.status-available {
  background: rgba(53, 208, 127, 0.1);
  color: #78e7aa;
}

.status-pending {
  background: rgba(251, 191, 36, 0.09);
  color: #fbd56b;
}

.document-open {
  align-items: center;
  background: transparent;
  border: 1px solid var(--control-border);
  border-radius: 0.7rem;
  color: var(--text);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.document-open:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #111827;
  transform: translateY(-1px);
}

.document-open.is-checking {
  cursor: wait;
  opacity: 0.65;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state > span {
  align-items: center;
  background: var(--surface-raised);
  border-radius: 50%;
  color: var(--brand);
  display: inline-flex;
  font-size: 1.3rem;
  height: 4rem;
  justify-content: center;
  width: 4rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 1rem 0 0.35rem;
}

.empty-state p {
  color: var(--muted);
  margin: 0 auto 1.2rem;
}

.docs-footer {
  background: #030810;
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.25rem;
}

.docs-footer-main,
.docs-footer-bottom,
.docs-footer-links {
  align-items: center;
  display: flex;
}

.docs-footer-main,
.docs-footer-bottom {
  justify-content: space-between;
}

.docs-footer-main p {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0.8rem 0 0;
}

.docs-footer-links {
  gap: 1.25rem;
}

.docs-footer-links a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.docs-footer-links a:hover {
  color: var(--brand);
}

.docs-footer-bottom {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 2rem;
  padding-top: 1rem;
}

.docs-footer-bottom i {
  color: var(--green);
  margin-right: 0.3rem;
}

.pdf-modal .modal-content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.pdf-modal .modal-header,
.pdf-modal .modal-footer {
  border-color: var(--border);
  padding: 1rem 1.2rem;
}

.pdf-modal .modal-header {
  align-items: center;
}

.modal-kicker {
  color: var(--brand);
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdf-modal .modal-title {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 0.3rem;
}

.modal-close {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  color: var(--text);
  display: flex;
  height: 2.6rem;
  justify-content: center;
  width: 2.6rem;
}

.pdf-viewer-shell {
  background: #0b1220;
  min-height: 72vh;
  padding: 0;
  position: relative;
}

.pdf-viewer {
  border: 0;
  height: 74vh;
  width: 100%;
}

.viewer-loading {
  align-items: center;
  color: var(--muted-strong);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.viewer-loading .spinner-border {
  color: var(--brand);
}

.viewer-loading.is-error {
  padding: 2rem;
  text-align: center;
}

.viewer-error-icon {
  align-items: center;
  background: rgba(251, 113, 133, 0.12);
  border-radius: 50%;
  color: var(--pink);
  display: inline-flex;
  font-size: 1.2rem;
  height: 3.5rem;
  justify-content: center;
  width: 3.5rem;
}

.viewer-error-copy {
  color: var(--muted);
  font-size: 0.82rem;
  margin: -0.35rem auto 0;
  max-width: 28rem;
}

.pdf-modal .modal-footer {
  color: var(--muted);
  font-size: 0.7rem;
  justify-content: space-between;
}

.pdf-modal .modal-footer i {
  color: var(--blue);
}

.document-toast {
  align-items: center;
  background: rgba(18, 34, 56, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  bottom: 1rem;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  left: 50%;
  max-width: 38rem;
  padding: 0.9rem 1rem;
  position: fixed;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  z-index: 2000;
}

.document-toast[hidden] {
  display: none;
}

.document-toast > span {
  color: var(--yellow);
}

.document-toast p {
  color: var(--muted-strong);
  font-size: 0.78rem;
  margin: 0;
}

.document-toast button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

@media (max-width: 991.98px) {
  .catalog-heading {
    grid-template-columns: 1fr;
  }

  .docs-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-stats > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .docs-stats > div:nth-child(4) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 767.98px) {
  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .catalog-result {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 0.75rem 0 0;
  }

  .document-group > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .group-count {
    display: none;
  }

  .document-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .document-status {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .document-open {
    grid-column: 3;
    grid-row: 1;
  }

  .document-open span {
    display: none;
  }

  .document-open {
    justify-content: center;
    padding-inline: 0;
    width: 2.55rem;
  }

  .docs-footer-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .docs-header .brand-mark > span:last-child {
    display: none;
  }

  .docs-hero {
    padding-top: calc(var(--header-height) + 3rem);
  }

  .docs-hero h1 {
    font-size: clamp(2.65rem, 14vw, 3.8rem);
  }

  .docs-stats {
    grid-template-columns: 1fr;
  }

  .docs-stats > div + div,
  .docs-stats > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .document-group > summary {
    gap: 0.75rem;
    padding: 1rem;
  }

  .group-copy small {
    display: none;
  }

  .document-list {
    padding-inline: 1rem;
  }

  .document-copy strong {
    font-size: 0.8rem;
  }

  .document-status {
    font-size: 0.7rem;
  }

  .docs-footer-links {
    flex-wrap: wrap;
  }

  .docs-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .pdf-viewer-shell {
    min-height: calc(100vh - 9.5rem);
  }

  .pdf-viewer {
    height: calc(100vh - 9.5rem);
  }

  .pdf-modal .modal-footer {
    display: none;
  }
}
