:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0d6efd;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

body.dark {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #60a5fa;
  --border: #1f2937;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

body {
  font-family: Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0,0,0,.04);
}

.navbar-brand {
  color: var(--primary) !important;
  font-size: 1.45rem;
}

.search-box {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.site-main {
  padding-top: 28px;
  padding-bottom: 28px;
}

article.bg-white,
.card,
.list-group-item,
.site-footer {
  background: var(--card) !important;
  color: var(--text);
  border-color: var(--border);
}

article.bg-white {
  border-radius: 18px !important;
  box-shadow: var(--shadow) !important;
}

h1 {
  font-weight: 800;
  color: var(--text);
  line-height: 1.5;
}

.lead,
.text-muted {
  color: var(--muted) !important;
}

.badge {
  padding: 8px 14px;
  border-radius: 20px;
}

.viewer-box {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow);
}

.viewer-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.btn {
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border: none;
}

.list-group-item {
  padding: 14px 18px;
}

.list-group-item:hover {
  background: rgba(13,110,253,.08) !important;
  color: var(--primary);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
}

.footer-title {
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--primary);
}

.back-to-top {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow);
  z-index: 999;
}

.back-to-top.show {
  display: flex;
}

@media (max-width: 768px) {
  .site-main {
    padding-top: 16px;
  }

  article.bg-white {
    padding: 18px !important;
    border-radius: 14px !important;
  }

  h1 {
    font-size: 1.35rem !important;
  }

  .lead {
    font-size: 1rem;
  }

  .viewer-box {
    height: 70vh;
    min-height: 430px;
    border-radius: 12px;
  }

  .search-box {
    max-width: 100%;
  }

  .btn-lg {
    width: 100%;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .viewer-box {
    height: 65vh;
    min-height: 360px;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }
}