:root {
  --bg-main: #050815;
  --bg-elevated: #0b1028;
  --bg-elevated-soft: #05091d;
  --border-subtle: rgba(89, 246, 255, 0.35);
  --text-primary: #f7f7ff;
  --text-muted: #a0a3c2;
  --accent: #ff4ecd;
  --accent2: #4de5ff;
  --accent3: #a96bff;
  --radius-md: 10px;
  --radius-pill: 999px;
  --nav-height: 64px;
}

/* Global layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151a3a 0, var(--bg-main) 40%, #020308 90%);
  color: var(--text-primary);
}

body {
  display: flex;
}

.legal-root {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Top nav (copied / simplified from main app) */
.top-nav {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
      90deg,
      rgba(255, 78, 205, 0.1),
      rgba(77, 229, 255, 0.06) 40%,
      transparent
    ),
    rgba(5, 8, 21, 0.98);
  backdrop-filter: blur(18px);
  gap: 8px;
}

.legal-top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.logo-btn.readonly {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 30% 0, rgba(255, 78, 205, 0.4), transparent 55%);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 40px;
  height: 40px;
}

.logo-icon i {
  font-size: 20px;
}

.app-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-title {
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
}

.version-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at top, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.2));
  color: #e3f9ff;
}

.app-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* Content area */
.legal-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.legal-content {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Section cards */
.doc-section-card {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(255, 78, 205, 0.2), transparent 55%),
    var(--bg-elevated-soft);
  padding: 14px 16px 16px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
}

.doc-section-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.doc-section-title {
  margin: 0;
  font-size: 20px;
}

.doc-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.doc-section-body p {
  margin: 0.4rem 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Subcards inside each section */
.doc-subcard {
  border-radius: 10px;
  border: 1px dashed rgba(77, 229, 255, 0.45);
  background: linear-gradient(
      135deg,
      rgba(77, 229, 255, 0.08),
      rgba(255, 78, 205, 0.08)
    );
  padding: 10px 10px 8px;
  margin-top: 10px;
}

.doc-subcard h3,
.doc-subcard h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.doc-subcard h4 {
  font-size: 14px;
}

.doc-subcard p {
  margin: 0.3rem 0;
}

/* List item cards */
.section-list {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0 0.3rem;
}

.section-list.nested {
  margin-top: 0.2rem;
}

.section-list > li {
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  padding: 5px 8px;
  margin-bottom: 4px;
  font-size: 13px;
  background: rgba(5, 8, 21, 0.7);
}

.section-list.nested > li {
  border-radius: 5px;
  border-style: dashed;
  border-width: 1px;
  border-color: rgba(77, 229, 255, 0.3);
  background: rgba(5, 8, 21, 0.85);
}

/* Text helpers */
strong {
  font-weight: 600;
}

/* Footer */
.legal-footer {
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(
      180deg,
      rgba(77, 229, 255, 0.08),
      rgba(255, 78, 205, 0.04)
    ),
    #050814;
  padding: 10px 16px;
}

.legal-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.legal-footer-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* Social links (copied from styles.css) */
.social-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-circle-link {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.18s ease-out, color 0.18s ease-out, transform 0.18s ease-out,
    box-shadow 0.18s ease-out;
}

.icon-circle-link:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(77, 229, 255, 0.6);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .top-nav {
    padding-inline: 10px;
  }

  .legal-main {
    padding: 12px;
  }

  .doc-section-card {
    padding: 12px;
  }

  .legal-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}