.detail-page {
  & :is(.brand-domain, .doc-kicker, .mobile-menu-title) {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--subtle);
  }

  & :is(.hint-link, .md-viewer a) {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    color: rgb(247, 247, 247);
    text-underline-offset: 3px;
  }

  & :is(.mobile-menu-inner, .mobile-menu-group) {
    display: grid;
    gap: 8px;
  }

  & .brand-copy {
    min-width: 0;
  }

  & .brand-domain {
    margin-top: 2px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  & .btn-icon {
    width: 18px;
    height: 18px;
  }

  & .doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
  }

  & .doc-desc {
    max-width: 660px;
    margin-top: 18px;
    font-size: 1rem;
    line-height: 1.76;
    color: var(--muted);
  }

  & .doc-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
    gap: 28px;
    align-items: stretch;
  }

  & .doc-kicker {
    font-size: 1.1rem;
  }

  & .doc-meta {
    max-width: 780px;
  }

  & .doc-stats-panel {
    min-height: 100%;
    padding: 24px;
  }

  & .doc-title {
    max-width: 12ch;
    margin-top: 12px;
    font-size: clamp(2.3rem, 4vw, 4.2rem);
    font-weight: 700;
    line-height: 1.16;
    color: var(--text);
  }

  & .fallback-desc {
    max-width: 44ch;
    line-height: 1.72;
    color: var(--muted);
  }

  & .fallback-icon {
    width: 54px;
    height: 54px;
    color: rgb(216, 216, 216);
  }

  & .fallback-message {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
    background: rgba(8, 8, 8, 0.96);
  }

  & .fallback-message.visible {
    display: flex;
  }

  & .fallback-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
  }

  & .footer-panel.detail-footer {
    margin-top: 56px;
  }

  & .ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    color: rgb(216, 216, 216);
    background: rgba(255, 255, 255, 0.055);
    cursor: pointer;
  }

  & .ghost-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
  }

  & .hero-section {
    display: block;
    padding: 74px 0 48px;
  }

  & .hint-item {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-size: 0.88rem;
    line-height: 1.5;
  }

  & .hint-item svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
  }

  & .info-card {
    padding: 22px;
  }

  & .info-desc {
    margin-top: 10px;
    font-size: 0.94rem;
    line-height: 1.72;
    color: var(--muted);
  }

  & .info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  & .info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: rgb(255, 255, 255);
  }

  & .info-icon svg {
    width: 19px;
    height: 19px;
  }

  & .lang-toggle {
    height: 38px;
  }

  & .md-loading {
    color: var(--muted);
  }

  & .md-viewer {
    height: 100%;
    overflow: auto;
    padding: clamp(20px, 3vw, 38px);
    line-height: 1.75;
    color: rgb(216, 216, 216);

    & :is(h1, h2, h3, h4, h5, h6) {
      font-weight: 700;
      line-height: 1.2;
      color: var(--text);
    }

    & :is(p, ul, ol, pre, table, blockquote, hr) {
      margin-top: 14px;
    }

    & :is(th, td) {
      padding: 10px 12px;
      border: 1px solid var(--line);
      text-align: left;
      white-space: nowrap;
      vertical-align: top;
    }

    & :is(ul, ol) {
      padding-left: 1.4rem;
    }

    & blockquote {
      padding: 2px 0 2px 16px;
      border-left: 3px solid var(--text);
      color: var(--muted);
    }

    & code {
      padding: 0.12em 0.4em;
      border: 1px solid var(--line);
      border-radius: 6px;
      font-family: Consolas, "Liberation Mono", Menlo, monospace;
      font-size: 0.92em;
      color: rgb(255, 255, 255);
      background: rgba(255, 255, 255, 0.06);
    }

    & h1 {
      font-size: clamp(1.8rem, 3vw, 2.6rem);
    }

    & h2 {
      margin-top: 36px;
      font-size: 1.45rem;
    }

    & h3 {
      margin-top: 26px;
      font-size: 1.12rem;
    }

    & hr {
      height: 1px;
      border: 0;
      background: var(--line);
    }

    & img {
      max-width: 100%;
      height: auto;
      vertical-align: middle;
    }

    & li + li {
      margin-top: 8px;
    }

    & pre {
      overflow: auto;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: rgb(11, 11, 11);
    }

    & pre code {
      padding: 0;
      border: 0;
      background: transparent;
    }

    & table {
      display: block;
      width: 100%;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      border-collapse: collapse;
    }

    & td {
      background: rgba(255, 255, 255, 0.03);
    }

    & th {
      font-weight: 700;
      color: var(--text);
      background: rgba(255, 255, 255, 0.08);
    }
  }

  & .menu-toggle {
    & .menu-bars {
      position: relative;
      width: 16px;
      height: 14px;
      transform: none;
    }

    & .menu-bars span {
      position: absolute;
      left: 0;
      width: 16px;
      height: 2px;
      border-radius: 999px;
      background: rgb(255, 255, 255);
    }

    & .menu-bars span:first-child {
      top: 0;
    }

    & .menu-bars span:last-child {
      top: 12px;
    }

    & .menu-bars span:nth-child(2) {
      top: 6px;
    }

    &.is-active .menu-bars {
      transform: none;
    }

    &.is-active .menu-bars span:first-child {
      transform: translateY(6px) rotate(45deg);
    }

    &.is-active .menu-bars span:last-child {
      transform: translateY(-6px) rotate(-45deg);
    }

    &.is-active .menu-bars span:nth-child(2) {
      opacity: 0;
    }
  }

  & .mobile-menu-cta {
    width: 100%;
    margin-top: 4px;
  }

  & .mobile-menu-title {
    padding: 4px 8px 0;
    font-size: 0.76rem;
  }

  & .pdf-viewer-wrapper {
    position: relative;
    width: 100%;
    height: 76vh;
    min-height: 520px;
    background: rgb(8, 8, 8);
  }

  & .stat-item {
    min-height: 58px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  & .stat-item:last-child {
    border-bottom: 0;
  }

  & .stat-value {
    margin-top: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.55;
    color: rgb(244, 244, 244);
  }

  & .viewer-container {
    overflow: hidden;
  }

  & .viewer-hint {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
  }

  @media (width < 1024px) {
    & :is(.brand-domain, .ghost-btn) {
      display: none;
    }

    & :is(.doc-actions, .primary-btn, .secondary-btn) {
      width: 100%;
    }

    & :is(.doc-intro, .info-grid) {
      grid-template-columns: 1fr;
    }

    & :is(.doc-stats-panel, .info-card) {
      padding: 18px;
    }

    & .doc-title {
      max-width: 9ch;
      font-size: 2.35rem;
    }

    & .nav-actions {
      margin-left: auto;
    }

    & .pdf-viewer-wrapper {
      height: 64vh;
      min-height: 420px;
    }

    & .topbar {
      position: relative;
      flex-wrap: wrap;
    }

    & .viewer-hint {
      flex-direction: column;
      align-items: flex-start;
    }
  }
}

.detail-page :is(.doc-stats-panel, .viewer-container, .info-card) {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255, 255, 255, 0.035);
}

.detail-page :is(.stat-label, .info-title, .sub) {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(133, 133, 133);
}

.detail-page .status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: var(--border-card);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-chip);
}

.detail-page .status-badge.completed {
  background: rgba(255, 255, 255, 0.12);
}

.is-preparing-reveal .detail-page .hero-section {
  visibility: hidden;
}

.pdf-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgb(17, 17, 17);
}
