html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body > main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
}

.terms-container {
  width: 100%;
  max-width: 880px;
  height: calc(100vh - 260px);
  overflow-y: auto;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;

  padding: 60px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
  line-height: 1.7;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  text-align: left;
  box-sizing: border-box;

  scroll-behavior: auto;
  overflow-anchor: none;
}

.terms-container > * {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}

.terms-header {
  background: #4f6f93;
  color: #ffffff;
  padding: 28px;
  border-radius: 14px;
  margin-bottom: 40px;
}

.terms-header h1 {
  font-size: 38px;
  margin: 0 0 10px 0;
  font-weight: 700;
  text-align: center;
}

.terms-header p {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  text-align: left;
}

.terms-header a {
  color: #eaf3ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-header a:hover {
  color: #ffffff;
}

.terms-toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 28px;
  border-radius: 14px;
  margin-bottom: 50px;
  text-align: left;
}

.terms-toc h2 {
  margin: 0 0 14px 0;
  font-size: 18px;
  text-align: center;
}

.terms-toc ol {
  margin: 0;
  padding-left: 20px;
}

.terms-toc a {
  text-decoration: none;
  color: #1e293b;
  transition: color 0.2s ease;
}

.terms-toc a:hover {
  color: #2563eb;
}

.terms-section {
  margin-bottom: 50px;
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.terms-section h2 {
  font-size: 22px;
  margin: 0 0 14px 0;
  font-weight: 600;
  text-align: left;
}

.terms-section h3 {
  font-size: 16px;
  margin: 20px 0 6px 0;
  text-align: left;
}

.terms-section p {
  margin: 0 0 14px 0;
  color: #444;
  text-align: left;
}

.terms-section ul {
  padding-left: 22px;
  margin: 0 0 14px 0;
}

.terms-section li {
  margin-bottom: 6px;
}

.terms-footer {
  margin-top: 60px;
  padding: 28px;
  background: #8ebcf1;
  color: #ffffff;
  font-size: 14px;
  text-align: center;
  border-radius: 12px;
}

.terms-footer a {
  color: #eaf3ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-footer a:hover {
  color: #ffffff;
}

@media (max-width: 768px) {
  body > main {
    padding: 20px 14px;
  }

  .terms-container {
    padding: 28px 18px;
    height: calc(100vh - 240px);
  }

  .terms-header {
    padding: 26px 18px;
  }

  .terms-header h1 {
    font-size: 28px;
  }
}