html {
  scroll-behavior: smooth;
}

.sop-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  color: #e8ecf1;
  overflow: visible;
}

.sop-header {
  margin-bottom: 2rem;
}

.sop-header .eyebrow {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fb3ff;
}

.sop-header h1 {
  margin: 0 0 0.75rem;
  font-size: 2.2rem;
  line-height: 1.15;
  color: #ffffff;
}

.sop-intro {
  max-width: 860px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #c7d0db;
}

.sop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
  overflow: visible;
}

.sop-main {
  min-width: 0;
}

.sop-toc {
  align-self: start;
  min-width: 0;
}

.sop-toc-box {
  position: sticky;
  top: 100px;
  padding: 0.95rem 1rem;
  background: rgba(18, 24, 38, 0.72);
  border: 1px solid rgba(143, 179, 255, 0.08);
  border-radius: 10px;
}

.sop-toc-box h2 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  line-height: 1.3;
  color: #ffffff;
}

.sop-toc-box ul,
.sop-jump-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sop-toc-box li + li,
.sop-jump-list li + li {
  margin-top: 0.35rem;
}

.sop-toc-box a,
.sop-jump-list a {
  display: block;
  padding: 0.38rem 0.3rem 0.38rem 0.55rem;
  border-left: 2px solid transparent;
  border-radius: 6px;
  color: #c7d0db;
  text-decoration: none;
  font-size: 0.93rem;
  line-height: 1.35;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.sop-toc-box a:hover,
.sop-toc-box a:focus,
.sop-jump-list a:hover,
.sop-jump-list a:focus {
  color: #8fb3ff;
  border-left-color: #8fb3ff;
  background: rgba(143, 179, 255, 0.05);
}

.sop-toc-mobile {
  display: none;
}

.sop-section {
  margin: 0 0 1.5rem;
  padding: 1.3rem 1.35rem;
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid rgba(143, 179, 255, 0.08);
  border-radius: 10px;
}

.sop-section[id] {
  scroll-margin-top: 110px;
}

.sop-section h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(143, 179, 255, 0.08);
  font-size: 1.3rem;
  line-height: 1.3;
  color: #ffffff;
}

.sop-section p {
  margin: 0 0 1rem;
  line-height: 1.7;
  color: #c7d0db;
}

.sop-section strong {
  color: #ffffff;
}

.sop-section > p > strong {
  display: inline-block;
  margin-bottom: 0.35rem;
}

.sop-section ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.sop-section li {
  margin-bottom: 0.7rem;
  line-height: 1.7;
  color: #d6deea;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}

.sop-section table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(10, 14, 24, 0.82);
  border: 1px solid rgba(143, 179, 255, 0.08);
}

.sop-section thead {
  background: rgba(79, 110, 170, 0.18);
}

.sop-section th,
.sop-section td {
  padding: 0.88rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(143, 179, 255, 0.07);
}

.sop-section th {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f5f8fc;
}

.sop-section td {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #d6deea;
}

.sop-section tbody tr:hover {
  background: rgba(143, 179, 255, 0.04);
}

.sop-section code {
  display: inline-block;
  padding: 0.16rem 0.42rem;
  border: 1px solid rgba(143, 179, 255, 0.14);
  border-radius: 6px;
  background: rgba(8, 12, 20, 0.95);
  color: #8fd3ff;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
  white-space: nowrap;
}

.sop-section .table-wrapper + p,
.sop-section p + .table-wrapper,
.sop-section .table-wrapper + .table-wrapper {
  margin-top: 1rem;
}

.danger-zone {
  background: rgba(42, 14, 18, 0.9);
  border: 1px solid rgba(255, 107, 107, 0.16);
}

.danger-zone h2 {
  color: #ffb3b3;
  border-bottom-color: rgba(255, 107, 107, 0.14);
}

.danger-zone li {
  color: #ffd5d5;
}

.danger-zone code {
  background: rgba(28, 8, 10, 0.95);
  border-color: rgba(255, 107, 107, 0.2);
  color: #ffb3b3;
}

@media (max-width: 1200px) {
  .sop-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .sop-page {
    padding: 1.5rem 1rem 3rem;
  }

  .sop-layout {
    grid-template-columns: 1fr;
  }

  .sop-toc {
    display: none;
  }

  .sop-toc-mobile {
    display: block;
  }
}

@media (max-width: 768px) {
  .sop-header h1 {
    font-size: 1.8rem;
  }

  .sop-intro {
    font-size: 0.96rem;
  }

  .sop-section {
    padding: 1.05rem;
  }

  .sop-section h2 {
    font-size: 1.14rem;
  }

  .sop-section table {
    min-width: 600px;
  }

  .sop-section th,
  .sop-section td {
    padding: 0.75rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .sop-page {
    padding: 1.2rem 0.75rem 2.5rem;
  }

  .sop-header h1 {
    font-size: 1.55rem;
  }

  .sop-section {
    padding: 0.95rem 0.9rem;
  }

  .sop-section code {
    font-size: 0.85em;
  }
}
