:root {
  --primary-color: #0c499c;
  --primary-dark: #083a7c;
  --secondary-color: #ffb517;
  --warm-orange: #fb923c;
  --warm-cream: #fff9f5;
  --soft-blue: #e3f2fd;
  --light-blue: #bbdefb;
  --nav-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #e3f2fd 100%);
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --main-bg: linear-gradient(to bottom, #d6e9f5 0%, #f8f3eb 50%, #ffffff 100%);
  --main-card-bg: rgba(255, 250, 240, 1.0);
}

[data-theme="dark"] {
  --primary-color: #60a5fa;
  --primary-dark: #3b82f6;
  --secondary-color: #fbbf24;
  --warm-orange: #fb923c;
  --warm-cream: #1f2937;
  --soft-blue: #1e3a5f;
  --light-blue: #1e40af;
  --nav-bg: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #1e3a5f 100%);
  --text-color: #e5e7eb;
  --text-light: #9ca3af;
  --border-color: #374151;
  --bg-light: #1f2937;
  --white: #111827;
  --main-bg: linear-gradient(to bottom, #0f172a 0%, #1e293b 50%, #111827 100%);
  --main-card-bg: rgba(31, 41, 55, 1.0);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background: url('/images/Background.jpeg') center center/cover no-repeat fixed, var(--main-bg);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background:
    linear-gradient(rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.88)),
    url('/images/Background.jpeg') center center/cover no-repeat fixed,
    var(--main-bg);
}

.navbar {
  background: var(--nav-bg) !important;
  border-bottom: 1px solid rgba(12, 73, 156, 0.2) !important;
  box-shadow: 0 2px 8px rgba(12, 73, 156, 0.1) !important;
  padding: 0 !important;
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .navbar {
  border-bottom: 1px solid rgba(96, 165, 250, 0.2) !important;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.1) !important;
}

.navbar .container-fluid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem !important;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

@media (max-width: 991.98px) {
  .navbar .container-fluid {
    flex-wrap: wrap;
  }
}

.navbar-brand {
  font-weight: 700 !important;
  color: var(--primary-color) !important;
  font-size: 1.8rem !important;
  letter-spacing: -0.5px !important;
  padding: 0.65rem 0 !important;
  text-transform: uppercase;
  flex-shrink: 0;
}

.navbar-brand__logo {
  display: inline-flex;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  margin-right: 12px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.navbar-brand__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.navbar-nav {
  gap: 0.35rem;
}

@media (min-width: 992px) {
  .navbar-collapse {
    flex-wrap: nowrap !important;
    align-items: center;
  }

  .navbar .nav-link {
    white-space: nowrap;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }

  /* Lidt afstand mellem hovedmenu og GDPR/sprog/login */
  .navbar-nav.ms-auto {
    margin-left: 1rem !important;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
  }
}

[data-theme="dark"] .navbar-nav.ms-auto {
  border-left-color: rgba(255, 255, 255, 0.12);
}

/* Postkasse-badge: fuldt synlig også med mange menupunkter (admin) */
.navbar,
.navbar .container-fluid,
.navbar-collapse {
  overflow: visible !important;
}

.nav-item:has(#mailboxNavLink) {
  overflow: visible;
}

.mailbox-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.65rem !important;
  overflow: visible;
  line-height: 1;
}

.mailbox-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--primary-color);
}

.mailbox-nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mailbox-nav-link:hover .mailbox-nav-icon,
.mailbox-nav-link:focus-visible .mailbox-nav-icon {
  color: #083a7d;
}

[data-theme="dark"] .mailbox-nav-icon {
  color: #93c5fd;
}

.mailbox-nav-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  border: 1.5px solid var(--soft-blue);
  box-shadow: 0 1px 3px rgba(12, 73, 156, 0.25);
  z-index: 5;
  pointer-events: none;
}

[data-theme="dark"] .mailbox-nav-badge {
  border-color: #1e3a5f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Language menu: show ISO code instead of flag emoji (Windows often renders 🇸🇦 as "SA"). */
.language-switcher .lang-code,
.navbar-nav .dropdown-item .lang-code {
  display: inline-block;
  min-width: 2.4em;
  margin-right: 0.35em;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  opacity: 0.75;
  vertical-align: 0.05em;
}

.navbar-nav .nav-link {
  color: var(--text-color) !important;
  font-weight: 500 !important;
  padding: 0.75rem 0.65rem !important;
  transition: all 0.2s ease !important;
  border-radius: 4px;
  white-space: nowrap;
}

.nav-link {
  color: var(--text-color) !important;
  font-weight: 500 !important;
  padding: 0.75rem 1rem !important;
  transition: all 0.2s ease !important;
  border-radius: 4px;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background: var(--bg-light) !important;
}

#themeToggle {
  border: 2px solid var(--primary-color) !important;
  color: var(--primary-color) !important;
  background: transparent !important;
  font-size: 1.2rem !important;
  padding: 0.5rem !important;
  transition: all 0.3s ease !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#themeToggle:hover {
  background: var(--primary-color) !important;
  color: white !important;
  transform: scale(1.1) !important;
}

.nav-link.text-danger.fw-bold {
  color: var(--primary-color) !important;
  font-weight: 600 !important;
}

.btn {
  border-radius: 4px !important;
  padding: 0.5rem 1.5rem !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  transition: all 0.2s ease !important;
  border: none !important;
  text-transform: none !important;
}

.btn-primary {
  background: var(--primary-color) !important;
  color: white !important;
}

.btn-primary:hover {
  background: var(--primary-dark) !important;
  transform: none !important;
}

.btn-success {
  background: #28a745 !important;
  color: white !important;
}

.btn-success:hover {
  background: #218838 !important;
}

.btn-danger {
  background: #dc3545 !important;
  color: white !important;
}

.btn-danger:hover {
  background: #c82333 !important;
}

#forumAttachBtn {
  padding: 0.35rem 1rem !important;
  font-size: 0.8rem !important;
}

.btn-outline-success,
.btn-outline-primary {
  border-radius: 4px !important;
}

main {
  padding: 1.5rem 0;
  transition: background 0.3s ease;
}

.main-content {
  width: 98%;
  max-width: 2400px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--main-card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(12, 73, 156, 0.06);
  min-height: 100%;
  transition: background 0.3s ease;
  text-align: center;
}

.main-content form,
.main-content .card,
.main-content .row,
.main-content .alert,
.main-content table,
.main-content .list-group,
.main-content .list-group-item,
.main-content .custom-page-content,
.main-content .news-body {
  text-align: left;
}

/* CMS pages / news HTML: readable column; lists keep bullets with the text */
.custom-page-content,
.news-body {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.custom-page-content ul,
.custom-page-content ol,
.news-body ul,
.news-body ol {
  text-align: left;
  margin: 0.5rem 0 1rem;
  padding-left: 1.5rem;
}

.custom-page-content li,
.news-body li {
  text-align: left;
  margin: 0.35rem 0;
}

.custom-page-content h2,
.custom-page-content h3,
.news-body h2,
.news-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.custom-page-content h2:first-child,
.custom-page-content h3:first-child,
.news-body h2:first-child,
.news-body h3:first-child {
  margin-top: 0;
}

.main-content form {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.container {
  max-width: 100% !important;
  padding: 0 !important;
}

/* Ensure all content areas have consistent width */
.main-content .container,
.main-content .container-fluid,
.main-content > div {
  max-width: 100%;
  width: 100%;
}

.main-content .row {
  margin-left: 0;
  margin-right: 0;
}

.main-content .col,
.main-content [class*="col-"] {
  padding-left: 15px;
  padding-right: 15px;
}

.card {
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(12, 73, 156, 0.08) !important;
  overflow: hidden !important;
  transition: all 0.2s ease !important;
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%) !important;
}

[data-theme="dark"] .card {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(12, 73, 156, 0.15) !important;
  transform: translateY(-2px);
}

[data-theme="light"] .card:hover {
  background: linear-gradient(135deg, #f5f9ff 0%, #ffffff 100%) !important;
}

[data-theme="dark"] .card:hover {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
}

.card-header {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
  border-bottom: 1px solid rgba(12, 73, 156, 0.2) !important;
  padding: 1rem 1.5rem !important;
  font-weight: 600 !important;
}

.card-header.bg-info,
.card-header.bg-danger,
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-primary,
.card-header.bg-secondary {
  background-image: none !important;
}

.card-header.bg-info { background-color: #0dcaf0 !important; }
.card-header.bg-danger { background-color: #dc3545 !important; }
.card-header.bg-success { background-color: #198754 !important; }
.card-header.bg-warning { background-color: #ffc107 !important; }
.card-header.bg-primary { background-color: #0d6efd !important; }
.card-header.bg-secondary { background-color: #6c757d !important; }

[data-theme="dark"] .card-header:not(.bg-info):not(.bg-danger):not(.bg-success):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.profile-tabs-header) {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%) !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.2) !important;
  color: #e5e7eb !important;
}

[data-theme="dark"] .card-header.profile-tabs-header {
  background: transparent !important;
  border-bottom: none !important;
  color: var(--text-color) !important;
}

.card-body {
  padding: 1.5rem !important;
}

.form-control, .form-select {
  border: 1px solid var(--border-color) !important;
  border-radius: 4px !important;
  padding: 0.5rem 0.75rem !important;
  transition: all 0.2s ease !important;
  color: var(--text-color) !important;
  background-color: var(--white) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  color: var(--text-color) !important;
  background-color: #374151 !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder {
  color: var(--text-light) !important;
  opacity: 0.7 !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(12, 73, 156, 0.1) !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.2) !important;
  color: var(--text-color) !important;
  background-color: #4b5563 !important;
}

.alert {
  border-radius: 6px !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.list-group-item {
  border: 1px solid var(--border-color) !important;
  border-radius: 0 !important;
  transition: all 0.2s ease !important;
  color: var(--text-color) !important;
}

.mailbox-inbox-row {
  display: block;
  width: 100%;
  cursor: pointer;
}

.mailbox-inbox-row .min-w-0 {
  min-width: 0;
}

[data-theme="dark"] .list-group-item {
  color: var(--text-color) !important;
  background: var(--bg-light) !important;
}

.list-group-item:hover {
  background: var(--bg-light) !important;
}

[data-theme="dark"] .list-group-item:hover {
  background: #374151 !important;
}

.footer {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
  border-top: 1px solid rgba(12, 73, 156, 0.2) !important;
  padding: 1rem !important;
  margin-top: 0 !important;
  text-align: center;
  transition: background 0.3s ease;
  flex: 0 0 auto;
}

[data-theme="dark"] .footer {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%) !important;
  border-top: 1px solid rgba(96, 165, 250, 0.2) !important;
  color: #e5e7eb !important;
}

.site-footer-legal {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 1.25rem 0.75rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.site-footer-legal__copy {
  margin-bottom: 0.5rem;
}

.site-footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.site-footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: var(--text-light);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.site-footer-social__link:hover,
.site-footer-social__link:focus-visible {
  color: var(--primary-color, #0d6efd);
  border-color: currentColor;
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .site-footer-social__link {
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .site-footer-social__link:hover,
[data-theme="dark"] .site-footer-social__link:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.site-footer-legal__links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.site-footer-legal__links a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

[data-theme="dark"] .site-footer-legal {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.badge {
  padding: 0.35rem 0.65rem !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  border-radius: 4px !important;
}

.bg-primary {
  background: var(--primary-color) !important;
}

.bg-success {
  background: #28a745 !important;
}

.bg-danger {
  background: #dc3545 !important;
}

.bg-warning {
  background: #ffc107 !important;
  color: #333 !important;
}

.bg-secondary {
  background: #6c757d !important;
}

/* Toast notification styles */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    background: var(--white);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border-left: 4px solid var(--primary-color);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.success {
    border-left-color: #28a745;
}

.toast-notification.warning {
    border-left-color: #ffc107;
}

.toast-content {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-message {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    margin-left: 1rem;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-color);
}

/* Clean modern button styles */
button, .btn {
  box-shadow: none !important;
}

button:focus, .btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(12, 73, 156, 0.1) !important;
}

/* Remove excessive animations */
.btn:hover {
  transform: none !important;
}

.nav-link:hover {
  transform: none !important;
}

/* Modern card hover effects */
.card:hover {
  transform: translateY(-2px);
}

.btn:hover {
  opacity: 0.9;
}

/* Chat popup styles */
#chatToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#chatToggle:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

#chatWindow {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  max-height: 700px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  z-index: 9998;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

#chatWindow.active {
  display: flex;
}

#chatHeader {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

#chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-height: 550px;
  background: var(--white);
}

.chat-message {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--bg-light);
}

.chat-message.own-message {
  background: rgba(12, 73, 156, 0.1);
  margin-left: 2rem;
}

.chat-message .sender-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.chat-message .message-content {
  color: var(--text-color);
  font-size: 1rem;
}

.chat-message .message-time {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

#chatInputContainer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

#chatInput {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

#chatInput:focus {
  outline: none;
  border-color: var(--primary-color);
}

#chatSendBtn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#chatSendBtn:hover {
  background: var(--primary-dark);
}

#chatCloseBtn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#chatCloseBtn:hover {
  opacity: 0.8;
}

.chat-status {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-top: 0.25rem;
}

/* Context menu styles */
#chatContextMenu {
  display: none;
  position: fixed;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10000;
  min-width: 180px;
  padding: 0.5rem 0;
}

.context-menu-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-color);
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.context-menu-item:hover {
  background-color: var(--bg-light);
}

.context-menu-item span {
  font-size: 0.9rem;
}

.sender-name {
  cursor: pointer;
  color: var(--primary-color) !important;
  text-decoration: underline !important;
}

/* Dark theme text overrides for forum */
[data-theme="dark"] .text-dark {
  color: var(--text-color) !important;
}

[data-theme="dark"] .text-muted {
  color: var(--text-light) !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-color) !important;
}

[data-theme="dark"] .list-group-item h5,
[data-theme="dark"] .list-group-item h4 {
  color: var(--text-color) !important;
}

[data-theme="dark"] .list-group-item p {
  color: var(--text-light) !important;
}

[data-theme="dark"] .list-group-item strong {
  color: var(--text-color) !important;
}

[data-theme="dark"] .card-body {
  color: #f3f4f6 !important;
}

[data-theme="dark"] .card-body p,
[data-theme="dark"] .card-body li,
[data-theme="dark"] .card-body h6 {
  color: #f3f4f6 !important;
}

[data-theme="dark"] .post-content,
[data-theme="dark"] .reply-content {
  color: var(--text-color) !important;
}

[data-theme="dark"] .card-body small,
[data-theme="dark"] .card-body .text-muted {
  color: var(--text-light) !important;
}

[data-theme="dark"] .list-group-item-action {
  color: var(--text-color) !important;
}

[data-theme="dark"] .list-group-item-action:hover {
  color: var(--text-color) !important;
  background: #374151 !important;
}

[data-theme="dark"] .list-group-item-action .text-muted {
  color: var(--text-light) !important;
}

[data-theme="dark"] .list-group-item-action strong {
  color: var(--text-color) !important;
}

/* Forum specific dark theme fixes */
[data-theme="dark"] .border-bottom {
  border-color: var(--border-color) !important;
}

.forum-group-title {
  color: var(--text-color) !important;
}

[data-theme="dark"] .forum-group-title {
  color: var(--text-color) !important;
}

/* Badge text in dark theme */
[data-theme="dark"] .badge.text-dark {
  color: #1f2937 !important;
}

[data-theme="dark"] .badge.bg-warning {
  color: #1f2937 !important;
}

/* Links in dark theme */
[data-theme="dark"] a {
  color: var(--primary-color) !important;
}

[data-theme="dark"] a:hover {
  color: var(--primary-dark) !important;
}

[data-theme="dark"] .list-group-item-action {
  color: var(--text-color) !important;
}

[data-theme="dark"] .list-group-item-action:hover {
  color: var(--text-color) !important;
}

/* Small text in dark theme */
[data-theme="dark"] small {
  color: var(--text-light) !important;
}

[data-theme="dark"] .small {
  color: var(--text-light) !important;
}

/* Alert text in dark theme */
[data-theme="dark"] .alert {
  color: var(--text-color) !important;
}

[data-theme="dark"] .alert strong {
  color: var(--text-color) !important;
}

[data-theme="dark"] .alert-warning {
  background-color: #78350f !important;
  border-color: #92400e !important;
  color: #fef3c7 !important;
}

[data-theme="dark"] .alert-warning strong {
  color: #fef3c7 !important;
}

[data-theme="dark"] .alert-info {
  background-color: #1e3a5f !important;
  border-color: #2563eb !important;
  color: #dbeafe !important;
}

[data-theme="dark"] .alert-info strong {
  color: #dbeafe !important;
}

[data-theme="dark"] .alert-info a,
[data-theme="dark"] .alert-warning a {
  color: #60a5fa !important;
  text-decoration: underline !important;
}

[data-theme="dark"] .alert-info a:hover,
[data-theme="dark"] .alert-warning a:hover {
  color: #93c5fd !important;
}

[data-theme="dark"] .alert-secondary {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] .alert-secondary strong,
[data-theme="dark"] .alert-secondary em {
  color: var(--text-color) !important;
}

[data-theme="dark"] .alert-success {
  background-color: #064e3b !important;
  border-color: #047857 !important;
  color: #d1fae5 !important;
}

[data-theme="dark"] .alert-danger {
  background-color: #7f1d1d !important;
  border-color: #991b1b !important;
  color: #fee2e2 !important;
}

/* Buttons in dark theme — use solid darker blue (not light --primary-color) for contrast */
[data-theme="dark"] .btn-primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
}

[data-theme="dark"] .btn-primary:hover {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #1e40af !important;
}

[data-theme="dark"] .btn-success {
  background-color: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

[data-theme="dark"] .btn-success:hover {
  background-color: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
}

[data-theme="dark"] .btn-secondary {
  background-color: #4b5563 !important;
  color: #ffffff !important;
  border-color: #4b5563 !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: #374151 !important;
  color: #ffffff !important;
  border-color: #374151 !important;
}

[data-theme="dark"] .btn-outline-primary {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  background-color: transparent !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  border-color: var(--primary-color) !important;
}

[data-theme="dark"] .btn-outline-secondary {
  border-color: #6b7280 !important;
  color: var(--text-color) !important;
  background-color: transparent !important;
}

[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: #4b5563 !important;
  color: #ffffff !important;
  border-color: #4b5563 !important;
}

[data-theme="dark"] .btn-outline-danger {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  background-color: transparent !important;
}

[data-theme="dark"] .btn-outline-danger:hover {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* Form labels in dark theme */
[data-theme="dark"] .form-label {
  color: var(--text-color) !important;
}

/* Input group in dark theme */
[data-theme="dark"] .input-group .form-control {
  color: var(--text-color) !important;
  background-color: #374151 !important;
}

[data-theme="dark"] .input-group .btn-outline-secondary {
  color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  background-color: #374151 !important;
}

[data-theme="dark"] .input-group .btn-outline-secondary:hover {
  background-color: #4b5563 !important;
  color: var(--text-color) !important;
}

/* Ensure input-group doesn't change input field size */
.input-group {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
}

.input-group .form-control {
  width: 100% !important;
  flex: 1 1 auto !important;
  position: relative !important;
}

.input-group .btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  height: auto !important;
  border-left: none !important;
  border-radius: 0 4px 4px 0 !important;
}

.input-group .form-control:not(:last-child) {
  border-radius: 4px 0 0 4px !important;
}

/* Make sure both email and password fields have same width */
form .mb-3 .form-control,
form .mb-3 .input-group {
  width: 100% !important;
  max-width: 100% !important;
}

/* Form check in dark theme */
[data-theme="dark"] .form-check-label {
  color: var(--text-color) !important;
}

[data-theme="dark"] .form-check-input {
  background-color: #374151 !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-check-input:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

/* All headings should use theme color */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-color) !important;
}

/* Ensure all text in main content is visible in dark theme */
[data-theme="dark"] .main-content {
  color: var(--text-color) !important;
}

[data-theme="dark"] .main-content * {
  color: inherit;
}

[data-theme="dark"] .main-content .text-muted {
  color: var(--text-light) !important;
}

[data-theme="dark"] .main-content .text-dark {
  color: var(--text-color) !important;
}

/* Forum group links */
[data-theme="dark"] a.text-decoration-none {
  color: var(--text-color) !important;
}

[data-theme="dark"] a.text-decoration-none:hover {
  color: var(--primary-color) !important;
}

/* Ensure em and italic text is visible */
[data-theme="dark"] em {
  color: var(--text-light) !important;
}

[data-theme="dark"] .text-muted em {
  color: var(--text-light) !important;
}

/* Public profile dashboard (#109) */
.profile-dashboard .profile-header-avatar {
  width: 96px;
}

.profile-dashboard .profile-header {
  border-color: var(--bs-border-color, #dee2e6) !important;
}

.profile-dashboard .profile-tabs-nav {
  overflow: visible;
}

.profile-dashboard > .card,
.profile-dashboard > .card:hover {
  overflow: visible !important;
  transform: none;
}

.profile-dashboard .profile-lego-mini-label {
  display: block;
  font-size: 0.8rem;
  line-height: 1.2;
  word-break: break-word;
}

.profile-lego-set-card__spin360 {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  z-index: 1;
}

.profile-dashboard .profile-stat-tile {
  background: var(--bg-light);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}

.profile-dashboard .profile-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.profile-dashboard .profile-stat-label {
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #6c757d);
}

.profile-dashboard a.profile-stat-tile-link,
.profile-dashboard button.profile-stat-tile-link {
  color: inherit;
  cursor: pointer;
  background: var(--bs-light, #f8f9fa);
}

.profile-dashboard a.profile-stat-tile-link:hover,
.profile-dashboard button.profile-stat-tile-link:hover {
  background: var(--bs-gray-200, #e9ecef);
}

.profile-dashboard .profile-section-card {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  padding: 1rem;
}

.profile-dashboard .profile-gallery-thumb {
  border: 1px solid var(--bs-border-color, #dee2e6);
  cursor: pointer;
  background: none;
  text-decoration: none;
  color: inherit;
}

.profile-dashboard .profile-gallery-thumb:hover {
  opacity: 0.92;
}

.gallery-folder {
  --gf-fill: #d2e0f2;
  --gf-paper: #b7c7e0;
  --gf-paper2: #a4b7d4;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  padding: 0 1.5rem 0.65rem 0.15rem;
  transition: transform 0.2s ease;
}

.gallery-folder:hover {
  color: inherit;
  transform: translateY(-2px);
}

.gallery-folder::before,
.gallery-folder::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0.55rem;
  right: 0.2rem;
  top: 1.85rem;
  bottom: 0.2rem;
  border-radius: 0 12px 12px 12px;
  background: var(--gf-paper);
  box-shadow: 0 7px 12px rgba(12, 73, 156, 0.16);
}

.gallery-folder::after {
  left: 0.25rem;
  right: 0.35rem;
  bottom: 0.38rem;
  background: var(--gf-paper2);
  transform: rotate(1.4deg);
  transform-origin: left bottom;
}

.gallery-folder__tab {
  position: relative;
  z-index: 2;
  isolation: isolate;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: calc(100% - 2.5rem);
  min-width: 4.5rem;
  margin-left: 1.15rem;
  margin-bottom: -1px;
  padding: 0.42rem 1.25rem 0.48rem 0.85rem;
  background: transparent;
}

.gallery-folder__tab::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--gf-fill);
  border-radius: 10px 14px 0 0;
  transform: skewX(-18deg);
  transform-origin: bottom left;
}

.gallery-folder__tab::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 100%;
  bottom: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background: radial-gradient(circle at 0 0, transparent 16px, var(--gf-fill) 17px);
}

.gallery-folder__name {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.gallery-folder__body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--gf-fill);
  border-radius: 0 14px 14px 14px;
  padding: 0.7rem 0.7rem 0.55rem;
}

.gallery-folder__preview {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #f7f9fd;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(12, 73, 156, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  transform: translateZ(0);
}

.gallery-folder__preview--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: #fff;
}

.gallery-folder__preview--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: #fff;
}

.external-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.external-login-btn__icon {
  display: inline-flex;
  line-height: 0;
}

.gallery-upload-preview {
  display: block;
  max-width: 220px;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #f7f9fd;
  border: 1px solid rgba(12, 73, 156, 0.16);
}

.gallery-folder__preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
}

.gallery-folder__preview:not(.gallery-folder__preview--grid):not(.gallery-folder__preview--pair) img {
  position: absolute;
  inset: 0;
}

.gallery-folder__cell {
  display: block;
  background: #e8eef6;
}

.gallery-folder__empty {
  width: 3rem;
  height: 3rem;
  color: #7d93b8;
}

.gallery-folder__icon {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  color: #0c499c;
}

.gallery-folder__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.15rem 0;
}

[data-theme="dark"] .gallery-folder {
  --gf-fill: #2c3c54;
  --gf-paper: #243044;
  --gf-paper2: #1c2636;
}

[data-theme="dark"] .gallery-folder::before {
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .gallery-folder__preview {
  background: #1b2433;
  border-color: #3a4a60;
}

[data-theme="dark"] .gallery-folder__preview--grid {
  background: #243044;
}

[data-theme="dark"] .gallery-folder__cell {
  background: #243044;
}

[data-theme="dark"] .gallery-folder__empty {
  color: #8ea0bc;
}

[data-theme="dark"] .gallery-folder__icon {
  color: #8eb4ff;
}

.profile-dashboard--context .card:last-of-type {
  margin-bottom: 0;
}

.image-details-profile-layer {
  position: relative;
}

.image-details-profile-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1020;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.image-details-profile-content {
  position: relative;
  z-index: 1025;
  background: var(--main-bg, #fff);
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  margin-bottom: 1.5rem;
}

header .navbar {
  position: relative;
  z-index: 1030;
}

[data-theme="dark"] .image-details-profile-content {
  background: var(--main-bg);
}

.image-details-photo-stage {
  position: relative;
  width: 100%;
  max-width: 42rem;
  height: min(52vh, 26rem);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 0.5rem;
  overflow: hidden;
}

.image-details-owner-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  display: flex;
  gap: 0.35rem;
}

.image-details-photo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

[data-theme="dark"] .image-details-photo-stage {
  background: rgba(255, 255, 255, 0.06);
}

.image-lightbox-body {
  background: #111;
}

.image-lightbox-stage {
  width: min(92vw, 42rem);
  height: min(58vh, 28rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.image-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

[data-theme="dark"] .profile-dashboard .profile-stat-tile,
[data-theme="dark"] .profile-dashboard .profile-section-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .profile-dashboard a.profile-stat-tile-link:hover,
[data-theme="dark"] .profile-dashboard button.profile-stat-tile-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.forum-staff-notice {
  border: 1px solid rgba(217, 119, 6, 0.45);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.forum-staff-notice--list {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  border-left: 4px solid #d97706 !important;
}

.forum-staff-notice--list:hover,
.forum-staff-notice--list:focus {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

.forum-post-lock {
  font-size: 0.9em;
  opacity: 0.7;
}

.forum-staff-notice__header,
.forum-staff-notice__body {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.forum-staff-notice .forum-staff-notice__header {
  border-bottom-color: rgba(217, 119, 6, 0.25);
}

[data-theme="dark"] .forum-staff-notice__header,
[data-theme="dark"] .forum-staff-notice__body,
[data-theme="dark"] .forum-staff-notice--list {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.22) 0%, rgba(180, 83, 9, 0.14) 100%) !important;
  border-left-color: #f59e0b !important;
}

[data-theme="dark"] .forum-staff-notice--list:hover,
[data-theme="dark"] .forum-staff-notice--list:focus {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.3) 0%, rgba(180, 83, 9, 0.2) 100%) !important;
}

[data-theme="dark"] .forum-staff-notice {
  border-color: rgba(251, 191, 36, 0.45);
}

/* Forum redesign (#86) */
.forum-layout .forum-list {
  border: 1px solid rgba(12, 73, 156, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.forum-list__head {
  background: #4a5568;
  color: #fff;
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  justify-content: space-between;
}

.forum-list__row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #f8f9fa;
}

.forum-list__row:last-child {
  border-bottom: none;
}

.forum-list__row--alt {
  background: #fff;
}

.forum-list__row:hover {
  background: #eef3fa;
}

.forum-list__status {
  width: 5px;
  flex-shrink: 0;
  border-radius: 0 4px 4px 0;
  background: transparent;
}

.forum-list__row--new .forum-list__status {
  background: #22c55e;
}

.forum-list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-left: 0.35rem;
}

.forum-list__title {
  font-weight: 600;
  color: #0c499c;
}

.forum-list__title--unread {
  font-weight: 700;
}

.forum-list__new-mark {
  color: #16a34a;
  font-weight: 800;
  margin-right: 0.2rem;
}

.forum-list__desc {
  font-size: 0.85rem;
}

.forum-list__meta {
  flex-shrink: 0;
  min-width: 3rem;
  text-align: right;
  align-self: center;
  font-weight: 600;
  padding-right: 0.25rem;
}

.forum-list__unread {
  color: #0c499c;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.forum-sidebar__box {
  border: 1px solid rgba(12, 73, 156, 0.15);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.forum-sidebar__head {
  background: linear-gradient(180deg, #5a6575, #3d4654);
  color: #fff;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.forum-sidebar__links {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.forum-sidebar__links a {
  display: block;
  padding: 0.4rem 0.85rem;
  color: #0c499c;
  text-decoration: none;
  font-size: 0.92rem;
}

.forum-sidebar__links a:hover {
  background: #eef3fa;
}

.forum-post-card {
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .forum-layout .forum-list,
[data-theme="dark"] .forum-sidebar__box,
[data-theme="dark"] .forum-list__row--alt {
  background: #1e2430;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .forum-list__row {
  background: #171c26;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .forum-list__row:hover {
  background: #252b38;
}

[data-theme="dark"] .forum-list__title,
[data-theme="dark"] .forum-sidebar__links a {
  color: #8eb6ef;
}

/* Home: guest intro (no banner photo) + news */
.home-intro {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.25rem;
  padding: 0.25rem 0 0.35rem;
}

.home-intro__tagline {
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text-light);
  margin: 0 0 1rem;
}

.home-news-layout--after-intro {
  margin-top: 1.25rem;
}

.home-guest-features {
  text-align: left;
}

.home-guest-features__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.home-guest-features__card {
  display: block;
  background: var(--main-card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  color: inherit;
  text-decoration: none;
}

a.home-guest-features__card:hover,
a.home-guest-features__card:focus-visible {
  border-color: var(--primary-color);
  color: inherit;
  text-decoration: none;
}

.home-guest-features__icon {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.home-guest-features__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
}

.home-guest-features__text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.35;
}

.what-can-i-build {
  text-align: left;
}

.what-can-i-build__tab {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-right: 0.35rem;
}

.what-can-i-build__tab .nav-link {
  margin-right: 0;
}

.what-can-i-build__help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid var(--border-color, #ced4da);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted, #6c757d);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}

.what-can-i-build__help:hover,
.what-can-i-build__help:focus {
  color: var(--text-color, #212529);
  border-color: var(--text-muted, #6c757d);
  outline: none;
}

.what-can-i-build__help-popover {
  max-width: 16rem;
}

.what-can-i-build__form,
.what-can-i-build__teaser {
  max-width: 36rem;
}

.what-can-i-build__set-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f9fc;
  padding: 6px;
}

.what-can-i-build__set-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lego-part-use {
  position: relative;
}

.lego-part-use__suggest {
  position: absolute;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  width: min(100%, 36rem);
}

.lego-part-use__part-img,
.lego-part-use__suggest img {
  object-fit: contain;
  background: #fff;
  border-radius: 0.25rem;
}

.lego-part-use__set {
  display: block;
  color: inherit;
}

.lego-part-use__set-thumb {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 0.35rem;
  padding: 6px;
  margin-bottom: 0.35rem;
}

.lego-part-use__set-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

[data-theme="dark"] .lego-part-use__set-thumb,
[data-theme="dark"] .lego-part-use__part-img {
  background: #1a1d21;
}

[data-theme="dark"] .what-can-i-build__set-thumb {
  background: rgba(255, 255, 255, 0.06);
}

.duel-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 56rem;
  margin: 0 auto;
}

.duel-choice__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--main-card-bg);
  color: inherit;
  overflow: hidden;
}

.duel-choice__btn img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg-light);
}

div.duel-choice__btn {
  cursor: default;
}

.duel-choice__btn span {
  display: block;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

.duel-podium__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.duel-podium__thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}

.duel-podium__place {
  font-weight: 700;
  width: 1.75rem;
  text-align: center;
}

.duel-podium__who {
  flex: 1;
  min-width: 0;
}

.duel-podium__pct {
  font-weight: 600;
  white-space: nowrap;
}

.profile-achievements {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.profile-achievements__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 0.35rem;
  background: var(--main-card-bg, #f8f9fa);
  border: 1px solid var(--border-color, #dee2e6);
}

.profile-lego-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  max-width: 100%;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--badge-color, #6c757d);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.2;
}

.profile-lego-badge--lg {
  min-height: 2.1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.profile-lego-badge__icon {
  display: inline-flex;
  width: 1.1em;
  height: 1.1em;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.profile-lego-badge__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-catalog__section {
  margin-bottom: 1.75rem;
}

.badge-catalog__heading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
}

.badge-catalog__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .badge-catalog__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .badge-catalog__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.badge-catalog__item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  opacity: 0.45;
  background: var(--main-card-bg);
  min-width: 0;
}

.badge-catalog__item--earned {
  opacity: 1;
}

.badge-catalog__icon {
  flex: 0 0 2rem;
  font-size: 1.6rem;
  line-height: 1.2;
  text-align: center;
}

.badge-catalog__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.badge-catalog__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.badge-catalog__desc {
  font-size: 0.85rem;
  color: var(--text-muted, #6c757d);
  line-height: 1.35;
}

@media (max-width: 991.98px) {
  .home-guest-features__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .home-guest-features__grid {
    grid-template-columns: 1fr;
  }

  .home-intro {
    padding-bottom: 0.15rem;
  }
}

@media (max-width: 575.98px) {
  .duel-pair {
    grid-template-columns: 1fr;
  }
}

/* Human-readable sitemap */
.sitemap {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 1rem;
}

.sitemap__title {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  color: var(--text-color);
}

.sitemap-section {
  margin-bottom: 1.5rem;
}

.sitemap-section__title {
  background: var(--primary-color, #0c499c);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
}

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

.sitemap-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  line-height: 1.4;
  color: var(--text-color);
}

.sitemap-list__item:last-child {
  border-bottom: none;
}

.sitemap-list__link {
  font-weight: 600;
  color: var(--primary-color, #0c499c);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sitemap-list__sep {
  color: var(--text-light);
}

.sitemap-list__desc {
  color: var(--text-light);
  flex: 1 1 8rem;
  min-width: 0;
}

[data-theme="dark"] .sitemap-section__title {
  background: #1e40af;
}

[data-theme="dark"] .sitemap-list__item {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sitemap-list__link {
  color: #93c5fd;
}

@media (max-width: 575.98px) {
  .sitemap {
    max-width: none;
  }

  .sitemap__title {
    font-size: 1.4rem;
  }

  .sitemap-list__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.85rem 0.25rem;
  }

  .sitemap-list__link {
    display: inline-block;
    padding: 0.15rem 0;
    font-size: 1.05rem;
  }

  .sitemap-list__sep {
    display: none;
  }

  .sitemap-list__desc {
    flex: none;
    font-size: 0.9rem;
  }
}

.home-news-layout {
  margin-top: 1.5rem;
}

.home-news-layout--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  align-items: start;
}

@media (min-width: 768px) {
  .home-news-layout--split {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 68rem;
  }
}

.home-news {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.home-news-layout--split .home-news,
.home-news-layout--split .home-lego-news {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

.home-news__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.home-news__title-row .home-news__title {
  margin-bottom: 0;
}

.home-lego-news__filter .form-select {
  max-width: 100%;
}

.home-lego-news__theme-link {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.home-lego-news__theme-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.home-lego-news__theme-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
  background: transparent;
}

.home-lego-news__theme-dot--has {
  opacity: 0.45;
}

.home-lego-news__theme-dot--selected {
  background: currentColor;
  opacity: 1;
}

.home-lego-news__row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.home-lego-news__thumb-btn {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0.35rem;
  overflow: hidden;
  line-height: 0;
}

.home-lego-news__thumb {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  background: var(--bs-secondary-bg, #f1f3f5);
}

.home-lego-news__main {
  flex: 1 1 auto;
}

.home-lego-news__main .card-title {
  margin-bottom: 0.35rem;
}

.home-lego-news__modal-image {
  display: block;
  width: 100%;
  max-height: min(70vh, 28rem);
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 0.35rem;
  background: var(--bs-secondary-bg, #f1f3f5);
}

.admin-lego-news__thumb {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  border-radius: 0.25rem;
  background: var(--bs-secondary-bg, #f1f3f5);
}

@media (max-width: 767.98px) {
  .admin-lego-news__thumb {
    width: 4.25rem;
    height: 4.25rem;
  }
}

.admin-lego-news__preview {
  display: block;
  max-width: 100%;
  max-height: 12rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  background: var(--bs-secondary-bg, #f1f3f5);
}

.home-news__title {
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
}

.home-news__card {
  text-align: left;
}

.home-news__card .card-title {
  margin-bottom: 0.65rem;
}

.home-news__preview {
  white-space: pre-line;
  margin-bottom: 1rem;
  line-height: 1.55;
  color: var(--text-color, inherit);
}

.home-news__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.home-lego-news__card .home-news__meta {
  justify-content: flex-end;
}

.home-news-modal .modal-title {
  margin: 0;
  padding-right: 0.5rem;
}

.home-news-modal .news-body {
  line-height: 1.55;
}

.news-body--plain {
  white-space: pre-line;
}

@media (max-width: 576px) {
  .home-news__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========== #115 Dark mode — Bootstrap / layout gaps ========== */
[data-theme="dark"] .navbar.navbar-light .navbar-brand,
[data-theme="dark"] .navbar.navbar-light .navbar-nav .nav-link {
  color: var(--text-color) !important;
}

[data-theme="dark"] .navbar.navbar-light .navbar-toggler {
  border-color: var(--border-color);
}

[data-theme="dark"] .navbar.navbar-light .navbar-toggler-icon {
  filter: invert(1) grayscale(100%);
}

[data-theme="dark"] .main-content {
  background: var(--main-card-bg);
  color: var(--text-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .table {
  --bs-table-color: var(--text-color);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-color);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.07);
  color: var(--text-color);
}

[data-theme="dark"] .table > :not(caption) > * > * {
  color: inherit;
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-content {
  background-color: var(--main-card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-header .btn-close {
  filter: invert(1) grayscale(100%);
}

[data-theme="dark"] .dropdown-menu {
  background-color: #1f2937;
  border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-color);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background-color: #374151;
  color: var(--text-color);
}

[data-theme="dark"] .dropdown-divider {
  border-color: var(--border-color);
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light {
  background-color: var(--bg-light) !important;
  color: var(--text-color);
}

[data-theme="dark"] .bg-body,
[data-theme="dark"] .bg-body-tertiary {
  background-color: var(--bg-light) !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .alert-info {
  background-color: #1e3a5f;
  border-color: #3b82f6;
  color: #e5e7eb;
}

[data-theme="dark"] .alert-success {
  background-color: #14532d;
  border-color: #22c55e;
  color: #e5e7eb;
}

[data-theme="dark"] .alert-warning {
  background-color: #78350f;
  border-color: #fbbf24;
  color: #fef3c7;
}

[data-theme="dark"] .alert-danger {
  background-color: #7f1d1d;
  border-color: #ef4444;
  color: #fee2e2;
}

[data-theme="dark"] .pagination .page-link {
  background-color: var(--bg-light);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: #111827;
  color: var(--text-light);
}

[data-theme="dark"] .input-group-text {
  background-color: #111827;
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .offcanvas {
  background-color: var(--main-card-bg);
  color: var(--text-color);
}

[data-theme="dark"] .accordion-item {
  background-color: var(--bg-light);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .accordion-button {
  background-color: var(--bg-light);
  color: var(--text-color);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: #1e3a5f;
  color: var(--text-color);
}

[data-theme="dark"] .ql-toolbar.ql-snow,
[data-theme="dark"] .ql-container.ql-snow {
  border-color: var(--border-color);
  background: #111827;
  color: var(--text-color);
}

[data-theme="dark"] .ql-editor,
[data-theme="dark"] .ql-editor.ql-blank::before {
  background-color: #111827;
  color: var(--text-color);
}

[data-theme="dark"] .ql-editor.ql-blank::before {
  color: #9ca3af;
}

[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: #9ca3af;
}

[data-theme="dark"] .ql-snow .ql-fill {
  fill: #9ca3af;
}

[data-theme="dark"] .ql-snow .ql-picker {
  color: var(--text-color);
}

[data-theme="dark"] .ql-snow .ql-picker-options {
  background-color: #111827;
  border-color: var(--border-color);
}

[data-theme="dark"] #themeToggle {
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .custom-page-content,
[data-theme="dark"] .news-body {
  color: var(--text-color);
}

[data-theme="dark"] .momentbricks-simple-html-editor .ql-toolbar.ql-snow,
[data-theme="dark"] .momentbricks-simple-html-editor .ql-container.ql-snow,
[data-theme="dark"] .momentbricks-simple-html-editor .ql-editor {
  background: #111827;
  color: var(--text-color);
}

.news-source-preview {
  background: #f8f9fa;
  color: #212529;
  max-height: 280px;
  overflow: auto;
}

[data-theme="dark"] .news-source-preview {
  background: #111827;
  color: var(--text-color);
  border-color: var(--border-color) !important;
}

.momentbricks-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
}

.momentbricks-busy-overlay.d-none {
  display: none !important;
}

.momentbricks-busy-overlay__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  background: rgba(17, 24, 39, 0.95);
  color: #f3f4f6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.momentbricks-busy-overlay__message {
  font-size: 0.95rem;
  text-align: center;
  max-width: 16rem;
}

html.momentbricks-busy,
html.momentbricks-busy body {
  cursor: wait;
}

.mailbox-sidebar {
  background-color: var(--bg-light);
}

[data-theme="dark"] .mailbox-sidebar .list-group-item {
  background-color: transparent;
}

[data-theme="dark"] .mailbox-sidebar .list-group-item.active {
  background-color: #1e3a5f;
  border-color: var(--primary-color);
  color: #e5e7eb;
}

[data-theme="dark"] .nav-tabs {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-tabs .nav-link {
  color: var(--text-light);
  border-color: transparent;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--main-card-bg);
  border-color: var(--border-color) var(--border-color) var(--main-card-bg);
  color: var(--text-color);
}

[data-theme="dark"] .profile-dashboard .profile-stat-tile,
[data-theme="dark"] .profile-dashboard .p-2.bg-light {
  background: #111827 !important;
  color: var(--text-color);
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] .form-control[readonly] {
  background-color: #111827 !important;
  color: var(--text-light);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%);
}

[data-theme="dark"] .text-body {
  color: var(--text-color) !important;
}

[data-theme="dark"] .text-secondary {
  color: #9ca3af !important;
}

[data-theme="dark"] .profile-dashboard .profile-stat-label {
  color: #d1d5db !important;
}

[data-theme="dark"] .profile-dashboard .profile-stat-tile {
  color: var(--text-color) !important;
}

[data-theme="dark"] .btn-info {
  color: #111827 !important;
  background-color: #67e8f9 !important;
  border-color: #67e8f9 !important;
  font-weight: 600;
}

[data-theme="dark"] .btn-outline-info {
  color: #67e8f9 !important;
  border-color: #67e8f9 !important;
}

[data-theme="dark"] .btn-outline-info:hover {
  color: #111827 !important;
  background-color: #67e8f9 !important;
}

[data-theme="dark"] .btn-primary {
  color: #fff !important;
  background-color: #2563eb !important;
  border-color: #1d4ed8 !important;
}

[data-theme="dark"] .btn-primary:hover {
  color: #fff !important;
  background-color: #1d4ed8 !important;
  border-color: #1e40af !important;
}

[data-theme="dark"] .btn-outline-primary {
  color: #93c5fd !important;
  border-color: #60a5fa !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
  color: #111827 !important;
  background-color: #93c5fd !important;
  border-color: #93c5fd !important;
}

[data-theme="dark"] .card .card-body,
[data-theme="dark"] .card .card-body p,
[data-theme="dark"] .card .card-body li,
[data-theme="dark"] .card .card-body h5,
[data-theme="dark"] .card .card-body h6,
[data-theme="dark"] .card .card-body strong,
[data-theme="dark"] .card .card-body small,
[data-theme="dark"] .card .card-body a:not(.btn) {
  color: #e5e7eb !important;
}

[data-theme="dark"] .card .card-body a:not(.btn) {
  color: #93c5fd !important;
}

[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert-info h5,
[data-theme="dark"] .alert-info p {
  color: #e5e7eb !important;
}

/* ========== Translator UI (oversætter) — mobile ========== */
.translator-ui {
  overflow-x: hidden;
  max-width: 100%;
}

.translator-ui .translator-lang-highlight {
  outline: 2px solid rgba(13, 110, 253, 0.55);
  outline-offset: 4px;
  border-radius: 0.375rem;
  transition: outline-color 0.4s ease, background-color 0.4s ease;
  background-color: rgba(13, 110, 253, 0.08);
}

.translator-ui tr.translator-lang-highlight {
  outline-offset: 0;
}

/* Glossary suggestion fill on translation cards */
.translator-ui .glossary-hints .glossary-fill-btn {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.translator-ui .translator-ui-select {
  width: auto;
  min-width: 10rem;
  max-width: 100%;
}

.translator-ui .translator-edit-form {
  max-width: 600px;
}

.translator-ui .translator-edit-form.card,
.translator-ui form.translator-edit-form {
  max-width: 600px;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

.translator-ui .string-translation-card form,
.translator-ui .string-translation-card .card,
.translator-ui #stringTranslationCards form {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

.translator-ui .news-source-preview,
.translator-ui .momentbricks-simple-html-editor,
.translator-ui .ql-editor {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.translator-ui .translator-stat-table td,
.translator-ui .translator-stat-table th {
  vertical-align: middle;
}

[data-theme="dark"] .translator-ui .translator-ui-panel.bg-light {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--border-color) !important;
}

@media (max-width: 575.98px) {
  .translator-ui {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .translator-ui .card:hover {
    transform: none;
  }

  .translator-ui .translator-ui-title {
    font-size: 1.35rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .translator-ui .translator-ui-select {
    width: 100%;
  }

  .translator-ui .translator-ui-panel {
    padding: 0.75rem !important;
  }

  .translator-ui .card-body {
    padding: 0.85rem;
  }

  .translator-ui .card-header {
    padding: 0.75rem 0.85rem;
  }

  .translator-ui .form-control,
  .translator-ui .form-select,
  .translator-ui textarea.form-control {
    width: 100%;
    max-width: 100%;
    font-size: 16px; /* avoid iOS zoom on focus */
  }

  .translator-ui .translator-auto-translate-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .translator-ui .translator-toolbar-btn,
  .translator-ui .translator-save-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Dashboard / toolbar rows: stack full-width so overflow-x:hidden cannot clip the button */
  .translator-ui .mb-3.d-flex.flex-wrap > .translator-toolbar-btn {
    flex: 1 1 100%;
  }

  .translator-ui .translator-tier-pills .nav-link {
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .translator-ui .translator-stat-table {
    font-size: 0.875rem;
  }

  .translator-ui .translator-stat-table td:first-child {
    word-break: break-word;
    max-width: 9.5rem;
  }

  .translator-ui .translator-stat-action {
    white-space: nowrap;
    min-height: 2.25rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .translator-ui .progress {
    font-size: 0.75rem;
  }

  .translator-ui .progress-bar {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .translator-ui .badge {
    white-space: normal;
    text-align: left;
    line-height: 1.25;
  }

  .translator-ui .table-responsive {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .translator-ui code {
    word-break: break-all;
  }

  .translator-ui .pagination .page-link {
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* #46 Notification bell */
.notification-bell__toggle {
  line-height: 1;
  padding: 0.25rem 0.45rem;
}

.notification-bell__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--bs-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.notification-bell__menu {
  width: min(22rem, 92vw);
  max-height: 24rem;
}

.notification-bell__list {
  max-height: 16rem;
  overflow-y: auto;
}

.notification-bell__item {
  white-space: normal;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.notification-bell__item--unread {
  background: rgba(var(--bs-primary-rgb), 0.08);
}

.notification-bell__item-text {
  line-height: 1.35;
}

.notification-bell__item-time {
  margin-top: 0.1rem;
}

/* #28 News reactions */
.content-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

/* Don't use Bootstrap's filled .btn.active (dark grey box) — keep outline look */
.content-reactions__btn.btn-outline-secondary.active,
.content-reactions__btn.btn-outline-secondary:active,
.content-reactions__btn.btn-outline-secondary:focus {
  color: var(--bs-secondary-color, #6c757d);
  background-color: transparent;
  border-color: var(--bs-secondary, #6c757d);
  box-shadow: none;
}

.content-reactions__btn.btn-outline-secondary.active {
  font-weight: 600;
  border-color: #495057;
  color: #495057;
}

[data-theme="dark"] .content-reactions__btn.btn-outline-secondary.active,
[data-theme="dark"] .content-reactions__btn.btn-outline-secondary:active,
[data-theme="dark"] .content-reactions__btn.btn-outline-secondary:focus {
  background-color: transparent !important;
  color: var(--text-color) !important;
  border-color: #9ca3af !important;
  box-shadow: none;
}

.content-reactions__voters-link {
  font-size: 0.85rem;
}

/* #131 Spin360 */
.spin360-viewer {
  touch-action: none;
  user-select: none;
  cursor: grab;
  max-width: 640px;
}

.spin360-viewer.is-dragging {
  cursor: grabbing;
}

.spin360-viewer__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f2f6ff, #e7eefc);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(12, 73, 156, 0.12);
}

.spin360-viewer__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.spin360-viewer__frame.is-active {
  /* opacity driven by JS for crossfade; class kept for a11y/debug */
}

.spin360-viewer__hint {
  margin-top: 0.5rem;
}

.spin360-ghost-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 420px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef3fb;
  border: 1px dashed rgba(12, 73, 156, 0.35);
}

.spin360-ghost {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.55;
  transform: translateX(-22%);
  filter: contrast(1.05);
}

.spin360-ghost-label {
  position: absolute;
  right: 0.6rem;
  bottom: 0.5rem;
  font-size: 0.75rem;
  color: #334155;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.spin360-frame-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spin360-frame-item {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(12, 73, 156, 0.15);
  cursor: grab;
  background: #f7f9fc;
}

.spin360-frame-item.is-dragging {
  opacity: 0.55;
}

.spin360-frame-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spin360-frame-ord {
  position: absolute;
  left: 0.25rem;
  top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 4px;
  padding: 0 0.3rem;
}

.spin360-frame-del {
  position: absolute;
  right: 0.15rem;
  top: 0.1rem;
  margin: 0;
}

[data-theme="dark"] .spin360-viewer__stage,
[data-theme="dark"] .spin360-ghost-wrap,
[data-theme="dark"] .spin360-frame-item {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.12);
}
