.regulations-viewer-page {
  background: linear-gradient(180deg, #f8f4ea 0%, #f3f5f8 220px, #f3f5f8 100%);
  min-height: 70vh;
}

.regulations-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.regulations-back-btn,
.regulations-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid rgba(16, 18, 27, 0.12);
  background: #fff;
  color: #1a1d29;
}

.regulations-back-btn:hover,
.regulations-tool-btn:hover {
  background: #fff8e8;
  border-color: rgba(212, 160, 23, 0.45);
  color: #1a1d29;
}

.regulations-viewer-toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.regulations-format-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.regulations-format-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(16, 18, 27, 0.1);
  background: #fff;
  color: #1a1d29;
  text-align: left;
  box-shadow: 0 8px 20px rgba(16, 18, 27, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.regulations-format-tab:hover {
  border-color: rgba(212, 160, 23, 0.45);
  background: #fffdf7;
}

.regulations-format-tab.is-active {
  border-color: rgba(212, 160, 23, 0.65);
  background: linear-gradient(135deg, #fff8e8 0%, #fff 70%);
  box-shadow: 0 10px 24px rgba(212, 160, 23, 0.18);
}

.regulations-format-tab__label {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.regulations-format-tab__short {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 600;
}

.regulations-format-tab.is-active .regulations-format-tab__short {
  color: #9a6b00;
}

.regulations-viewer-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.regulations-toc-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(16, 18, 27, 0.08);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(16, 18, 27, 0.05);
}

.regulations-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(16, 18, 27, 0.08);
}

.regulations-toc-nav {
  padding: 0.75rem 0.5rem 1rem;
}

.regulations-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.regulations-toc-list li {
  margin: 0;
}

.regulations-toc-list a {
  display: block;
  padding: 0.42rem 0.75rem;
  border-radius: 0.55rem;
  color: #4b5565;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.45;
}

.regulations-toc-list a:hover {
  background: rgba(212, 160, 23, 0.12);
  color: #1a1d29;
}

.regulations-toc-list li.is-sub a {
  padding-left: 1.35rem;
  font-size: 0.82rem;
}

.regulations-doc-card {
  border: 0;
  border-radius: 1.1rem;
  box-shadow: 0 16px 40px rgba(16, 18, 27, 0.08);
  overflow: hidden;
}

.regulations-doc-body {
  padding: 1.5rem 1.25rem;
}

.regulations-doc-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(16, 18, 27, 0.08);
}

.regulations-doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a6b00;
  margin-bottom: 0.5rem;
}

.regulations-doc-title {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.regulations-doc-meta {
  font-size: 0.9rem;
}

.regulations-doc {
  max-width: none;
}

.regulations-doc h1 {
  font-size: 1.7rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.regulations-doc h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(16, 18, 27, 0.08);
  scroll-margin-top: 96px;
}

.regulations-doc h3 {
  font-size: 1.08rem;
  margin-top: 1.35rem;
  scroll-margin-top: 96px;
}

.regulations-doc h4 {
  font-size: 1rem;
  margin-top: 1rem;
}

.regulations-doc blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid #d4a017;
  background: #fff9ea;
  border-radius: 0 0.75rem 0.75rem 0;
  color: #4b5565;
}

.regulations-doc blockquote p:last-child {
  margin-bottom: 0;
}

.regulations-doc table {
  width: 100%;
  margin: 1rem 0 1.25rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.regulations-doc th,
.regulations-doc td {
  border: 1px solid rgba(16, 18, 27, 0.12);
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.regulations-doc th {
  background: #f7f3ea;
  font-weight: 700;
}

.regulations-doc tr:nth-child(even) td {
  background: rgba(16, 18, 27, 0.02);
}

.regulations-doc code {
  background: rgba(16, 18, 27, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.88em;
}

.regulations-doc pre {
  background: #171a24;
  color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.75rem;
  overflow: auto;
  margin: 1rem 0 1.25rem;
}

.regulations-doc pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.regulations-doc hr {
  margin: 1.5rem 0;
  border-color: rgba(16, 18, 27, 0.1);
}

.regulations-doc ul,
.regulations-doc ol {
  padding-left: 1.25rem;
}

.regulations-doc a {
  color: #9a6b00;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 991.98px) {
  .regulations-format-tabs {
    grid-template-columns: 1fr;
  }

  .regulations-format-tab {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
  }

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

  .regulations-toc-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1080;
    width: min(88vw, 320px);
    max-height: none;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-radius: 0 1rem 1rem 0;
  }

  .regulations-toc-panel.is-open {
    transform: translateX(0);
  }
}

@media print {
  .regulations-viewer-toolbar,
  .regulations-toc-panel,
  .regulations-format-tabs,
  .pm-header,
  .pm-footer,
  .navbar,
  footer {
    display: none !important;
  }

  .regulations-viewer-page {
    background: #fff;
    padding: 0;
  }

  .regulations-viewer-layout {
    display: block;
  }

  .regulations-doc-card {
    box-shadow: none;
    border: 0;
  }

  .regulations-doc-body {
    padding: 0;
  }
}
