.doc-slider {
  --ds-gap: 1rem;
  --ds-document-font-size: 14px;
  --ds-button-background: #1d4ed8;
  --ds-button-text: #ffffff;
  --ds-button-hover-background: #1e40af;
  --ds-button-hover-text: #ffffff;
}
.doc-slider__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .75rem;
}
.doc-slider__counter { display: block; }
.doc-slider__navigation { display: flex; gap: .5rem; }
.doc-slider__button {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--ds-button-background);
  border-radius: .25rem;
  background: var(--ds-button-background);
  color: var(--ds-button-text);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.doc-slider__button:hover:not(:disabled), .doc-slider__button:focus-visible:not(:disabled) {
  border-color: var(--ds-button-hover-background);
  background: var(--ds-button-hover-background);
  color: var(--ds-button-hover-text);
}
.doc-slider__button:disabled { cursor: not-allowed; opacity: .5; }
.doc-slider__viewport { min-width: 0; }
.doc-slider__track {
  display: flex;
  gap: var(--ds-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 1rem;
  touch-action: pan-x;
  cursor: grab;
}
.doc-slider__track.is-dragging { cursor: grabbing; user-select: none; }
.doc-slider__track--hide-scrollbar { scrollbar-width: none; }
.doc-slider__track--hide-scrollbar::-webkit-scrollbar { display: none; }
.doc-slider__card {
  flex: 0 0 var(--ds-card-width, 100%);
  min-width: 0;
  scroll-snap-align: start;
}
.doc-slider__open {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}
.doc-slider__thumb { display: block; aspect-ratio: 4/3; overflow: hidden; }
.doc-slider__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.doc-slider__fallback { display: grid; height: 100%; place-items: center; border: 1px solid currentColor; }
.doc-slider__body, .doc-slider__name, .doc-slider__meta { display: block; }
.doc-slider__body { font-size: var(--ds-document-font-size); }
.doc-slider__name { line-height: 1.35; }
.doc-slider__meta { font-size: .86em; }
.doc-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  padding: 24px;
  overflow: auto;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(10px);
}
.doc-viewer.is-open { display: block; }
.doc-viewer__dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  width: min(1420px, 100%);
  height: min(900px, calc(100vh - 48px));
  margin: 0 auto;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .15);
}
.doc-viewer__preview {
  position: relative;
  min-width: 0;
  padding: 20px;
  background: #dfe3e8;
}
.doc-viewer__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}
.doc-viewer__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  box-sizing: border-box;
  display: grid;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, .75);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(8px);
}
.doc-viewer__sidebar {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  border-left: 1px solid #e5e7eb;
  background: #fff;
}
.doc-viewer__info {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}
.doc-viewer__label {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.doc-viewer__title {
  margin: 0;
  color: #16181d;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.doc-viewer__description {
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}
.doc-viewer__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.doc-viewer__meta-box {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}
.doc-viewer__meta-label {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.doc-viewer__meta-value {
  color: #16181d;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.doc-viewer__actions {
  display: grid;
  gap: 10px;
  padding: 24px;
}
.doc-viewer__button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.doc-viewer__button--primary { background: #16181d; color: #fff; }
.doc-viewer__button--secondary { border: 1px solid #e5e7eb; background: #fff; color: #16181d; }
.doc-viewer__footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid #e5e7eb;
}
.doc-viewer__counter {
  margin-bottom: 12px;
  color: #6b7280;
  font-size: 12px;
}
.doc-viewer__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.doc-viewer__nav button {
  min-height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #16181d;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.doc-viewer__description:empty { display: none; }
@media (max-width: 1000px) {
  .doc-viewer { padding: 12px; }
  .doc-viewer__dialog { height: auto; min-height: calc(100vh - 24px); grid-template-columns: 1fr; }
  .doc-viewer__preview { height: 62vh; }
  .doc-viewer__sidebar { border-top: 1px solid #e5e7eb; border-left: 0; }
}
@media (max-width: 540px) {
  .doc-viewer__preview { height: 54vh; padding: 10px; }
  .doc-viewer__meta { grid-template-columns: 1fr; }
}
