/* FLITC CMS + public responsive hardening */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* ===== Admin dashboard ===== */
@media (max-width: 991px) {
  .app-header .navbar-form {
    max-width: 42vw;
  }
  .app-header .navbar-form .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }
  .table-responsive,
  .box .table-responsive,
  .box-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-body .padding,
  .app-body .p-a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

@media (max-width: 767px) {
  .app-aside {
    max-width: 86vw;
  }
  .navbar-brand img,
  .app-logo {
    max-height: 36px !important;
    width: auto !important;
  }
  .box,
  .box-color {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .row > [class*="col-"] {
    min-width: 0;
  }
  .btn-group,
  .nav-tabs {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .form-horizontal .control-label {
    text-align: start !important;
  }
  /* login already handled in flitc-login-bg.css */
  .w-xxl,
  .w-xl {
    max-width: 100% !important;
  }
}

/* Admin search bar always usable */
.app-header form[role="search"] {
  display: flex !important;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.app-header form[role="search"] .form-control {
  min-width: 0;
  flex: 1 1 auto;
}

/* ===== Public Velocity theme safety ===== */
.velocity-container,
.velocity-section,
.velocity-hero,
.velocity-panel {
  max-width: 100%;
  box-sizing: border-box;
}

.velocity-hero__title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 767px) {
  .velocity-topbar,
  header {
    max-width: 100vw;
  }
  .velocity-search-dialog {
    width: min(100vw - 16px, 560px);
    max-width: calc(100vw - 16px);
  }
  .velocity-search-form,
  .velocity-search-form__field {
    width: 100%;
    max-width: 100%;
  }
  .velocity-search-form .velocity-field {
    width: 100%;
  }
}

/* Prevent fixed scene from creating horizontal scroll */
.flitc-login-scene,
.flitc-ai-diagram {
  max-width: 100vw;
}
