.site-code-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.site-code-header {
  text-align: center;
  padding-top: 1rem;
}

.site-code-header h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-family: "Uncial Antiqua", "Celtic Gothic", "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #d4af37;
}

.site-code-header p {
  margin: 0 auto 1rem;
  max-width: 52ch;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(214, 232, 244, 0.82);
}

.site-code-btn {
  appearance: none;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 0.48rem 0.75rem;
  background: linear-gradient(180deg, #2a2a2a, #0e0e0e);
  color: #d4af37;
  font: 700 0.78rem/1 Arial, sans-serif;
  cursor: pointer;
}

.site-code-btn:hover {
  border-color: rgba(212, 175, 55, 0.72);
}

.site-code-meta {
  font-size: 0.72rem;
  color: rgba(177, 195, 210, 0.78);
}

.site-code-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  grid-template-rows: minmax(min(70vh, 720px), 420px);
  gap: 0.75rem;
  align-items: stretch;
}

@media (max-width: 760px) {
  .site-code-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(min(70vh, 720px), 420px);
  }

  .site-code-sidebar {
    max-height: 40vh;
  }
}

.site-code-sidebar {
  border: 1px solid rgba(195, 158, 77, 0.28);
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.88);
  overflow: auto;
  min-height: 0;
  height: 100%;
}

.site-code-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-code-group:last-child {
  border-bottom: 0;
}

.site-code-group-label {
  padding: 0.55rem 0.7rem 0.35rem;
  font: 700 0.68rem/1 Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.88);
}

.site-code-file {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  padding: 0.42rem 0.7rem;
  background: transparent;
  color: rgba(228, 247, 255, 0.88);
  font: 400 0.78rem/1.25 "Consolas", "Courier New", monospace;
  cursor: pointer;
}

.site-code-file:hover {
  background: rgba(212, 175, 55, 0.08);
}

.site-code-file.is-active {
  border-left-color: #d4af37;
  background: rgba(212, 175, 55, 0.12);
  color: #fff;
}

.site-code-viewer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(195, 158, 77, 0.28);
  border-radius: 12px;
  background: rgba(4, 4, 4, 0.92);
  overflow: hidden;
}

.site-code-viewer-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.95);
}

.site-code-viewer-head strong {
  font: 600 0.82rem/1.2 "Consolas", "Courier New", monospace;
  color: #d4af37;
  word-break: break-all;
}

.site-code-viewer-actions {
  display: flex;
  gap: 0.45rem;
}

.site-code-pre-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.site-code-pre {
  margin: 0;
  padding: 0.85rem 0.95rem;
  font: 400 0.74rem/1.45 "Consolas", "Courier New", monospace;
  color: #d8ecff;
  white-space: pre;
  tab-size: 2;
}

.site-code-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: rgba(177, 195, 210, 0.78);
  font-size: 0.9rem;
}

.site-code-status {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.site-code-status.is-loading {
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #d4af37;
}

.site-code-status.is-error {
  border: 1px solid rgba(255, 120, 120, 0.45);
  color: #ffb4b4;
  background: rgba(80, 20, 20, 0.35);
}
