:root {
  --bg: #0c131b;
  --panel: #0a131a;
  --text: #eef2ff;
  --muted: #b6bfdc;
  --brand: #5b8cff;
  --brand-2: #79a3ff;
  --line: #273357;
  --cyan: #74d1d5;
  /* Footer Facebook + copyright + KS (requested) */
  --footer-accent: #73d1d6;
}

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

html {
  height: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Sticky footer: footer stays at bottom of the viewport when content is short */
body {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Poppins", "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  background: rgba(12, 19, 27, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 0;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--text);
}

.logo-image {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.logo-text {
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  gap: 1rem;
}

.main-nav a {
  color: #309da6;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.user-menu {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
}

.user-menu summary {
  list-style: none;
  color: #309da6;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu summary::after {
  content: " \25BE";
  font-size: 0.8rem;
}

.user-menu[open] summary,
.user-menu summary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  display: none;
  flex-direction: column;
  min-width: 190px;
  background: #10172f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem;
  z-index: 20;
}

.user-menu[open] > .user-menu-panel {
  display: flex;
}

.user-menu-panel a {
  display: block;
  padding: 0.45rem 0.55rem;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
}

/* Full screen mobile menu overlay */
.mobile-menu-overlay {
  display: none;
}

.mobile-menu-overlay.open {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
}

.mobile-menu-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(16, 23, 47, 0.98);
  z-index: 9999;
  padding: 1.15rem 6% 2rem;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  z-index: 100000;
}

.mobile-menu-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./images/backgroundLines.jpg") center / cover no-repeat;
  opacity: 0.2;
  z-index: 0;
}

.mobile-menu-inner {
  width: 100%;
  position: relative;
  z-index: 100001;
  min-height: 100%;
}

.mobile-menu-links {
  padding-bottom: 1.2rem;
}

.mobile-menu-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cyan);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu-user {
  text-align: center;
  margin-bottom: 0.7rem;
}

.mobile-menu-username {
  color: var(--cyan);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
}

.mobile-menu-role {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.15rem;
}

.mobile-menu-links a {
  width: 100%;
  max-width: 340px;
  text-align: center;
  padding: 0.75rem 0.9rem;
  color: #309da6;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(116, 209, 213, 0.25);
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}

.mobile-menu-links a:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.video-hero {
  width: 100%;
  background: transparent;
  margin-top: 10px;
}

.video-hero video {
  display: block;
  width: min(100%, 375px);
  height: auto;
  max-height: 72vh;
  object-fit: cover;
  margin: 0 auto;
}

.hero {
  padding: 4.5rem 0 3rem;
  background:
    linear-gradient(to bottom, rgba(10, 19, 26, 0.78), rgba(12, 19, 27, 0.94)),
    url("./images/orbital-101.jpg") center / cover no-repeat;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.2rem;
  align-items: start;
}

.eyebrow {
  margin: 0;
  color: var(--brand-2);
  font-weight: 600;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0.6rem 0 0.8rem;
}

.hero-copy {
  color: var(--muted);
  max-width: 56ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.btn {
  display: inline-block;
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #3d66d9);
  color: #fff;
}

.btn-secondary {
  border: 1px solid var(--line);
  color: var(--text);
}

/* Native <button> resets so .btn matches <a class="btn"> (gradient, no double border) */
button.btn {
  cursor: pointer;
  font: inherit;
}
button.btn-primary {
  border: none;
}
button.btn-secondary {
  background: transparent;
}

.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.hero-brand {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 0.8rem;
}

.small {
  font-size: 0.88rem;
  color: var(--muted);
}

.section {
  padding: 2.5rem 0;
}

.section-alt {
  background: #0a131a;
}

.page-hero {
  padding: 2.2rem 0 1.2rem;
  background: #0a131a;
  border-bottom: 1px solid rgba(116, 209, 213, 0.2);
}

.page-title {
  margin: 0;
  color: var(--cyan);
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.page-subtitle {
  text-align: center;
  color: var(--muted);
  margin-top: 0.65rem;
}

/* ---------- Custom error pages (404, 500, etc.) ---------- */
.error-page {
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-page .section {
  width: 100%;
}

.error-page-inner {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.error-page-image {
  display: block;
  margin: 0 auto 1.25rem;
  max-width: min(100%, 320px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.error-page-code {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
}

.error-page-title {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.error-page-message {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 1.65rem;
  font-size: 1.02rem;
}

.error-page-extra {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.error-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.error-page-actions .btn {
  min-width: 10rem;
}

h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

#solutions h2 {
  width: min(520px, 100%);
  margin: 0 auto 1rem;
  text-align: center;
  color: var(--cyan);
  border: 1px solid rgba(0, 215, 230, 0.9);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(0, 0, 0, 0.24) 2px,
      rgba(0, 0, 0, 0.24) 4px
    ),
    #040b16;
}

#solutions .section-intro {
  text-align: center;
  margin-bottom: 1rem;
}

.section-intro {
  color: var(--muted);
}

.solutions-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.solution-card {
  background:
    linear-gradient(90deg, #424343 0%, #020203 100%),
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 35%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px
    ),
    #03070f;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 0.75rem 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 320px;
  box-shadow: inset 0 0 0 1px rgba(116, 209, 213, 0.28);
  overflow: hidden;
}

.solution-card h3 {
  margin: 0.65rem 0 0.55rem;
  font-size: 1.05rem;
  color: var(--cyan);
  line-height: 1.18;
  text-align: center;
  font-weight: 500;
}

.solution-icon {
  width: min(100%, 218px);
  height: auto;
  max-width: 218px;
  object-fit: contain;
  object-position: center;
  margin-top: 0.1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.solution-card p {
  color: transparent;
  margin: 0;
  flex: 1;
  font-size: 0;
}

.link-btn {
  align-self: center;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 500;
  font-size: 1.05rem;
  margin-top: auto;
  cursor: pointer;
  padding: 0;
}

.link-btn::after {
  content: " \2192";
}

details {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

details + details {
  margin-top: 0.75rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details p {
  color: var(--muted);
}

.faq-list {
  max-width: 980px;
}

.faq-hero-image {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto 0.8rem;
}

.faq-list details {
  border: 1px solid #03bbff;
  border-radius: 0;
  background: #001f2d;
  padding: 0;
  overflow: hidden;
}

.faq-list details + details {
  margin-top: 0;
  border-top: 0;
}

.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-weight: 500;
  color: #8ad6ff;
  background: #022838;
  padding: 0.95rem 0.95rem;
  position: relative;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8ad6ff;
  font-size: 1.4rem;
  line-height: 1;
}

.faq-list details[open] summary {
  background: #004f96;
  color: #b8e3ff;
  border-bottom: 1px solid #03bbff;
}

.faq-list details[open] summary::after {
  content: "-";
}

.faq-list details p {
  color: #081726;
  background: #77a0d0;
  margin: 0;
  padding: 0.95rem;
  line-height: 1.65;
}

.contact-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-outer {
  position: relative;
}

.contact-bgimage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.16;
  pointer-events: none;
}

.contact-page-layout {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.2rem;
  align-items: start;
}

.contact-hero {
  position: relative;
}

.contact-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./images/bgimage-234.png") center / cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

.contact-hero .container {
  position: relative;
}

.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
  justify-content: center;
}

.contact-sweet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(116, 209, 213, 0.45);
  background: rgba(48, 157, 166, 0.12);
  color: var(--cyan);
  font-weight: 600;
  white-space: nowrap;
}

.contact-sweet-btn:hover {
  background: rgba(48, 157, 166, 0.18);
  text-decoration: none;
}

.contact-address h2,
.contact-vcard h2,
.contact-vcard .contact-qr-title {
  color: var(--cyan);
  margin: 0 0 0.4rem;
}

.contact-address {
  margin-bottom: 0;
  padding-bottom: 2.25rem;
  width: 100%;
}

.contact-vcard {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(116, 209, 213, 0.22);
  width: 100%;
}

.contact-vcard-download {
  margin-top: 0.75rem;
  display: inline-flex;
}

.contact-vcard .contact-qr-title {
  margin: 1rem 0 0.45rem;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 600;
}

.contact-left {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.contact-left > .contact-buttons {
  margin-bottom: 2.25rem;
}

.contact-address p {
  margin: 0;
}

.contact-map {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.contact-map iframe {
  width: 100%;
  height: 450px;
  max-width: 450px;
  display: block;
  margin: 0 auto;
  border: 0;
}

@media (max-width: 960px) {
  .contact-page-layout {
    grid-template-columns: 1fr;
  }
}


.contact-block {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 35%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px
    ),
    #03070f;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  padding: 1rem;
}

.contact-block h2 {
  color: var(--cyan);
  margin-bottom: 0.4rem;
}

.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  /* Fixed 50px bar — max-height alone lets the strip collapse to ~content height (~20px) */
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  /* Inset Facebook / KS from viewport edges (extra beyond .container 92%) */
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  text-align: center;
  display: flex;
  align-items: center;
}

.site-footer .container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  width: 100%;
  /* Slight inset inside the centered column so icons aren’t flush to the column edge */
  padding-inline: 0.5rem;
  box-sizing: border-box;
}

.footer-grid {
  display: contents;
}

.footer-note {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--footer-accent);
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-grid .footer-left {
  order: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.footer-grid .footer-right {
  order: 3;
}

.footer-facebook svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: var(--footer-accent);
}

.footer-facebook:hover svg {
  fill: #9ee8ec;
}

.footer-right {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.footer-ks {
  color: var(--footer-accent);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
}

.footer-ks:hover {
  color: #9ee8ec;
  text-decoration: none;
}

.qr-image {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 0.5rem;
}

.modal {
  border: 0;
  border-radius: 14px;
  width: min(980px, calc(100vw - 36px));
  padding: 0;
  background: transparent;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.modal-card {
  position: relative;
  background: #03101a;
  color: #8ad6ff;
  padding: 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--cyan);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 100ms linear, transform 340ms cubic-bezier(0.22, 0.7, 0.2, 1);
  width: 100%;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal[open] .modal-card {
  animation: modal-in-right 340ms cubic-bezier(0.22, 0.7, 0.2, 1);
}

.modal.is-closing .modal-card {
  opacity: 0;
  transform: translateX(800px);
  transition: opacity 1500ms linear, transform 1500ms cubic-bezier(0.22, 0.7, 0.2, 1);
}

@keyframes modal-in-right {
  from {
    opacity: 0;
    transform: translateX(800px);
  }
  30% {
    opacity: 1;
  }
  45% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.modal-image {
  width: min(650px, 100%);
  max-height: 220px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}

.modal-card #modalBody {
  line-height: 1.6;
  color: #309da6;
  margin: 0;
  flex: 1;
  overflow: auto;
  white-space: normal;
}

.modal-card #modalBody ul,
.modal-card #modalBody ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
  list-style-position: outside;
}

.modal-card #modalBody li {
  margin: 0.15rem 0;
  display: list-item;
  list-style-type: disc;
}

.modal-card #modalBody ul {
  list-style-type: disc;
}

.modal-card #modalBody ol {
  list-style-type: decimal;
}

.modal-card #modalBody li::marker {
  color: #309da6;
}

.modal-card #modalBody li::after {
  content: "";
  display: block;
  clear: both;
}

.modal-card #modalBody img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.5rem auto;
}

.modal-card #modalBody li > img {
  float: left;
  max-width: 140px;
  margin: 0.1rem 0.8rem 0.35rem 0;
  display: block;
}

.modal-card #modalBody li > h4 {
  display: block;
  margin: 0.05rem 0 0.35rem;
}

.modal-card #modalBody .consultation-cta {
  text-align: center;
  margin: 1.1rem 0 0;
}

.close-btn {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  border: 0;
  background: transparent;
  color: var(--cyan);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.close-btn:focus,
.close-btn:focus-visible,
.close-btn:active {
  outline: none;
  box-shadow: none;
  border: 0;
}

#modalTitle {
  text-align: center;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 960px) {
  .solutions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: inline-block;
  }

  body.no-scroll {
    overflow: hidden;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 23, 47, 0.98);
    border: 0;
    border-radius: 0;
    padding: 2.8rem 5% 2rem;
    display: none;
    flex-direction: column;
    min-width: 0;
    z-index: 9999;
    overflow-y: auto;
    backdrop-filter: blur(8px);
    gap: 0.55rem;
    align-items: stretch;
    justify-content: flex-start;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    max-width: 340px;
    text-align: center;
    font-size: 1.08rem;
    padding: 0.75rem 0.9rem;
    display: block;
    margin: 0;
    line-height: 1.2;
    color: #309da6 !important;
  }

  .main-nav > a,
  .main-nav > details.user-menu {
    width: 100%;
    max-width: none;
    align-self: stretch;
  }

  .main-nav * {
    position: relative;
    z-index: 10000;
  }

  .main-nav > details.user-menu {
    width: 100%;
    max-width: 340px;
  }

  .main-nav > details.user-menu summary {
    width: 100%;
    display: block;
    text-align: center;
    color: #309da6 !important;
  }

  /* On mobile overlay, make the dropdown panel participate in layout (not absolute) */
  .main-nav > details.user-menu .user-menu-panel {
    position: static !important;
    top: auto !important;
    right: auto !important;
    min-width: 0 !important;
    background: transparent;
    border: 0;
    padding: 0.25rem 0 0;
    display: none;
    flex-direction: column;
    gap: 0.15rem;
  }

  .main-nav > details.user-menu[open] .user-menu-panel {
    display: flex;
  }

  .main-nav > details.user-menu .user-menu-panel a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.55rem 0;
  }

  .solutions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-panel {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .solutions-grid {
    grid-template-columns: 1fr;
  }

  /* Use mobile overlay instead of dropdown main nav */
  #mainNav {
    display: none !important;
  }
}

/* Mobile menu lightbox (more robust breakpoint) */
@media (max-width: 960px) {
  .menu-toggle {
    display: inline-block;
  }

  body.no-scroll {
    overflow: hidden;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 23, 47, 0.98);
    border: 0;
    border-radius: 0;
    padding: 2.8rem 5% 2rem;
    display: none;
    flex-direction: column;
    min-width: 0;
    z-index: 9999;
    overflow-y: auto;
    backdrop-filter: blur(8px);
    gap: 0.55rem;
    align-items: stretch;
    justify-content: flex-start;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    max-width: 340px;
    text-align: center;
    font-size: 1.08rem;
    padding: 0.75rem 0.9rem;
    display: block;
    margin: 0;
    line-height: 1.2;
    color: #309da6 !important;
  }

  .main-nav > a,
  .main-nav > details.user-menu {
    width: 100%;
    max-width: none;
    align-self: stretch;
  }

  .main-nav * {
    position: relative;
    z-index: 10000;
  }

  .main-nav > details.user-menu {
    width: 100%;
    max-width: 340px;
  }

  .main-nav > details.user-menu summary {
    width: 100%;
    display: block;
    text-align: center;
  }

  .main-nav > details.user-menu .user-menu-panel {
    position: static !important;
    top: auto !important;
    right: auto !important;
    min-width: 0 !important;
    background: transparent;
    border: 0;
    padding: 0.25rem 0 0;
    display: none;
    flex-direction: column;
    gap: 0.15rem;
  }

  .main-nav > details.user-menu[open] .user-menu-panel {
    display: flex;
  }

  .main-nav > details.user-menu .user-menu-panel a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.55rem 0;
  }
}

/* ---------- Consultation line ---------- */
.consultation-line {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.consultation-line a {
  color: var(--cyan);
}

/* ---------- Slideshow ---------- */
.slideshow {
  margin-top: 2rem;
  overflow: hidden;
  max-width: 100%;
}
.slideshow-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  transition: transform 0.6s ease-in-out;
}
.slideshow-slide {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}
.slideshow-slide img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100px;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.slideshow-lightbox {
  width: min(1100px, calc(100vw - 32px));
}

.slideshow-lightbox-card {
  padding-top: 1.8rem;
}

.slideshow-lightbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding-right: 0.2rem;
}

.slideshow-lightbox-grid img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #081420;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem;
}

/* ---------- Slideshow library (admin) ---------- */
.slideshow-upload-dz {
  min-height: 140px;
}

.slideshow-lib-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.slideshow-lib-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(3, 16, 26, 0.7);
}

.slideshow-lib-item img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  display: block;
  background: transparent;
}

.slideshow-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.slideshow-drag-handle {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  cursor: grab;
  user-select: none;
  font-size: 0.9rem;
}

.slideshow-drag-handle:active {
  cursor: grabbing;
}

.slideshow-delete:hover {
  background: rgba(0, 0, 0, 0.78);
}

/* ---------- Login page ---------- */
.login-page {
  padding: 4rem 0;
  min-height: 50vh;
}
.login-container {
  max-width: 360px;
  margin: 0 auto;
}
.login-title {
  text-align: center;
  color: var(--cyan);
  margin-bottom: 1.5rem;
}
.login-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.login-form label span {
  font-size: 0.9rem;
  color: var(--cyan);
}
.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.login-form .btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem;
}
.login-error {
  color: #e57373;
  text-align: center;
  margin-bottom: 1rem;
}

/* ---------- Edit page ---------- */
.edit-page .page-title {
  margin-bottom: 1.5rem;
  color: var(--cyan);
}

.edit-grid {
  display: grid;
  gap: 1.25rem;
}

.edit-card {
  background: #0a1722;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.edit-card .dz-area {
  width: 218px;
  min-height: 200px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(48, 157, 166, 0.08);
}

.edit-card .dz-area.dz-started {
  min-height: 200px;
}

.edit-card .dz-area img {
  max-width: 218px;
  max-height: 200px;
  object-fit: contain;
}

.edit-card .dz-area .dz-message {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}

.edit-card .dz-area.dz-over {
  border-color: var(--cyan);
  background: rgba(48, 157, 166, 0.12);
}

.edit-card .fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edit-card .fields input[type="text"],
.edit-card .fields textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c131b;
  color: var(--cyan);
  font-family: inherit;
}

.edit-card .fields textarea {
  min-height: 80px;
  resize: vertical;
}

.edit-answer-dz {
  width: 100%;
  max-width: 650px;
  min-height: 120px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(48, 157, 166, 0.06);
  overflow: hidden;
}

.edit-answer-dz .dz-message {
  color: var(--muted);
  font-size: 0.85rem;
}

.edit-answer-dz img {
  max-width: 650px;
  max-height: 280px;
  object-fit: contain;
}

.edit-answer-dz.dz-over {
  border-color: var(--cyan);
  background: rgba(48, 157, 166, 0.12);
}

.edit-card .edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.edit-card .edit-actions button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-size: 0.9rem;
}

.edit-card .edit-actions button:hover {
  background: rgba(48, 157, 166, 0.15);
}

.edit-card .edit-actions .btn-delete {
  color: #e57373;
  border-color: rgba(229, 115, 115, 0.4);
}

.edit-card .edit-actions .btn-delete:hover {
  background: rgba(229, 115, 115, 0.12);
}

.edit-page .add-solution {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  background: rgba(48, 157, 166, 0.15);
  color: var(--cyan);
  cursor: pointer;
  font-size: 1rem;
}

.edit-page .add-solution:hover {
  background: rgba(48, 157, 166, 0.25);
}

.edit-card.sortable-ghost {
  opacity: 0.5;
}

/* Edit page */
.edit-page {
  padding: 2rem 0;
}
.edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.edit-header h1 {
  margin: 0;
  font-size: 1.5rem;
}
.edit-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  min-height: 120px;
}
.edit-card {
  background: var(--panel);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
}
.edit-card-handle {
  cursor: grab;
  color: var(--cyan);
  font-size: 1.2rem;
  padding: 0.25rem;
  user-select: none;
  flex-shrink: 0;
}
.edit-card-handle:active {
  cursor: grabbing;
}
.edit-card-body {
  flex: 1;
  min-width: 0;
}
.edit-card-body label {
  display: block;
  font-size: 0.8rem;
  color: var(--cyan);
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
}
.edit-card-body label:first-child {
  margin-top: 0;
}
.edit-title {
  width: 100%;
  padding: 0.4rem;
  background: #0a131a;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  font-size: 0.95rem;
}
.edit-answer {
  width: 100%;
  padding: 0.4rem;
  background: #0a131a;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  font-size: 0.9rem;
  resize: vertical;
}
.dropzone {
  min-height: 80px;
  border: 2px dashed var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #0a131a;
}
.dropzone.over {
  border-color: var(--cyan);
  background: rgba(116, 209, 213, 0.1);
}
.dropzone-text {
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}
.dropzone-preview {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}
.dropzone-input {
  display: none;
}
.edit-actions {
  margin-top: 0.75rem;
}
.btn-delete {
  background: transparent;
  border: 1px solid #c53030;
  color: #c53030;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-delete:hover {
  background: rgba(197, 48, 48, 0.2);
}
.add-row {
  margin-top: 1.5rem;
}
.edit-page .error {
  color: #c53030;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.dashboard-btn {
  text-align: center;
  width: 100%;
  max-width: none;
  min-height: 86px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-grid .btn {
  padding: 0;
}

.backup-panel {
  margin-top: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(48, 157, 166, 0.08);
}

.backup-panel h2 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  color: var(--cyan);
}

.backup-form {
  margin-top: 0.65rem;
}

.backup-form .btn {
  background: #081420;
  border: 1px solid rgba(116, 209, 213, 0.45);
  color: var(--cyan);
}

.backup-form .btn:hover {
  background: #0b1d2d;
}

.backup-success {
  margin-top: 0.7rem;
  color: #8de89a;
}

.backup-list {
  margin-top: 1rem;
  border-top: 1px solid rgba(116, 209, 213, 0.25);
  padding-top: 0.85rem;
}

.backup-list h3 {
  margin: 0 0 0.7rem;
  color: var(--cyan);
  font-size: 1rem;
}

.backup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(116, 209, 213, 0.18);
}

.backup-row:first-of-type {
  border-top: 0;
}

.backup-row-main {
  min-width: 0;
}

.backup-name {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.backup-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.backup-row-actions form {
  margin: 0;
}

.backup-row-actions .backup-download-btn {
  box-sizing: border-box;
}

.backup-row-actions .btn,
.backup-row-actions .backup-delete-btn {
  background: #081420;
  border-color: rgba(116, 209, 213, 0.45);
  color: var(--cyan);
  border-width: 1px;
  border-style: solid;
}

.backup-row-actions .backup-download-btn,
.backup-row-actions .backup-delete-btn {
  width: 92px;
  height: 29px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.backup-row-actions .backup-delete-btn {
  appearance: none;
  -webkit-appearance: none;
}

.backup-row-actions .btn:hover,
.backup-row-actions .backup-delete-btn:hover {
  background: #0b1d2d;
}

@media (max-width: 720px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .dashboard-btn {
    min-height: 76px;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
  }

  .backup-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .backup-row-actions {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .stats-grid .stat-card {
    min-height: 84px;
  }
}

/* Force 2x2 stats layout on smaller screens (some mobile widths exceed 720px) */
@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .stats-grid .stat-card {
    min-height: 84px;
  }
}

.stats-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(48, 157, 166, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.stats-grid .stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 92px;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  margin-top: 0.2rem;
  font-size: 0.95rem;
}

.stats-grid .stat-label {
  margin-top: 0.35rem;
}

.stats-lists {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.stat-list h3 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  color: var(--cyan);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-row-left {
  color: var(--text);
  font-weight: 600;
}

.stat-row-right {
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
}

.small.muted {
  color: var(--muted);
}

.media-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.media-grid .media-card.btn-primary {
  background: #73d1d6;
  color: #0c131b;
  border: 1px solid rgba(12, 19, 27, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.media-grid .media-card.btn-primary:hover {
  background: #8ee4e8;
  color: #0c131b;
  text-decoration: none;
  border-color: rgba(12, 19, 27, 0.28);
}

.media-grid .media-card.btn-primary .small {
  color: rgba(12, 19, 27, 0.72);
}

.media-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 260px;
  text-align: left;
  text-decoration: none;
}

.media-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: inherit;
}

.media-preview {
  width: 100%;
  max-width: min(100%, 360px);
  height: 160px;
  object-fit: contain;
  border: 1px solid rgba(12, 19, 27, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.65rem;
}

.media-video-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: rgba(12, 19, 27, 0.55);
}

.media-video-thumb--failed {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(12, 19, 27, 0.65);
}
