html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  background: #f9f9f9;
  color: #222;
  overflow-wrap: break-word;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 12px;
  background: #fff;
  color: #222;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

header,
footer {
  text-align: center;
  padding: 15px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

footer {
  border-top: 1px solid #ddd;
  border-bottom: none;
  font-size: 14px;
  color: #666;
  background-color: #f9f9f9;
}

main {
  width: min(100%, 700px);
  padding: 20px;
  margin: 20px auto;
  text-align: center;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: 20px;
  color: #333;
}

header h2 {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
}

.file-info p {
  margin: 8px 0;
}

.file-info strong {
  color: #444;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 300px;
  margin: 20px auto 0;
}

.links a {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  border-radius: 10px;
  transition: background 0.25s;
}

.links a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Button colors */
.mega {
  background: #7028e4;
}

.mega:hover {
  background: #5a1fbb;
}

.gdrive {
  background: #34a853;
}

.gdrive:hover {
  background: #2b8c44;
}

.telegram {
  background: #333;
}

.telegram:hover {
  background: #111;
}

.error {
  color: red;
  text-align: center;
  margin-top: 20px;
  font-weight: bold;
}

.note-text {
  margin-top: 15px;
  font-size: 14px;
  color: #555;
  text-align: center;
  line-height: 1.6;
}

.note-link {
  color: #0073e6;
  text-decoration: none;
}

.note-link:hover,
.note-link:focus-visible {
  text-decoration: underline;
}

.comments {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #ddd;
  text-align: left;
  overflow: hidden;
}

.comments h2 {
  margin: 0 0 16px;
  font-size: 20px;
  color: #333;
  line-height: 1.3;
}

.giscus,
.giscus-frame {
  max-width: 100%;
}

@media (max-width: 768px) {
  header,
  footer {
    padding: 14px 16px;
  }

  main {
    padding: 18px 16px 24px;
    margin: 12px auto;
  }
}

@media (max-width: 480px) {
  header,
  footer {
    padding: 12px;
  }

  main {
    padding: 16px 12px 22px;
  }

  .note-text {
    font-size: 13px;
  }

  .links {
    max-width: none;
  }

  .links a {
    padding: 11px 10px;
    font-size: 14px;
  }

  .comments {
    margin-top: 32px;
    padding-top: 20px;
  }
}

@media (max-width: 360px) {
  header h2 {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.35rem;
    margin-bottom: 16px;
  }

  main {
    padding: 14px 10px 20px;
  }

  .comments h2 {
    font-size: 18px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  main {
    margin: 10px auto;
  }

  .comments {
    margin-top: 24px;
  }
}
