/*
 * FASE 2 — felles mobilbredde, BuddyBoss-varsler og Fluent Forms-kontrast.
 * Fellesskap beholder sitt eget stilark. Desktop-maksbredder over 900 px urørt.
 */

@media (max-width: 899.98px) {
  body.tg-app:not(.lima-felles-page) #content.site-content {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  body.tg-app:not(.lima-felles-page) #content.site-content :is(
    .container,
    .bb-container,
    .bb-grid,
    .site-content-grid,
    #primary,
    main#main,
    .entry-content,
    .tg-faults-wrap,
    .tg-faults-inner,
    .fluentform,
    .frm-fluent-form,
    .bp-wrap,
    .buddypress-wrap,
    .bp-settings-container
  ) {
    box-sizing: border-box;
    width: auto;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  body.tg-app:not(.lima-felles-page) .tg-faults-wrap {
    position: static;
    left: auto;
    right: auto;
  }

  body.tg-app:not(.lima-felles-page) .bp-settings-container {
    display: block;
  }

  body.tg-app:not(.lima-felles-page) .bp-settings-container .bp-navs {
    flex: none;
    width: 100%;
    min-height: 0;
    border-right: 0;
  }

  body.tg-app:not(.lima-felles-page) .fluentform .ff-el-group,
  body.tg-app:not(.lima-felles-page) .fluentform .ff-t-container,
  body.tg-app:not(.lima-felles-page) .fluentform .ff-t-cell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.tg-app:not(.lima-felles-page) .fluentform input.ff-el-form-control,
  body.tg-app:not(.lima-felles-page) .fluentform textarea.ff-el-form-control,
  body.tg-app:not(.lima-felles-page) .fluentform select.ff-el-form-control,
  body.tg-app:not(.lima-felles-page) .tg-faults-inner select,
  body.tg-app:not(.lima-felles-page) .tg-faults-inner input,
  body.tg-app:not(.lima-felles-page) .tg-faults-inner textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* BuddyBoss-varsler på LiMa-sider. Fellesskap har egen overflate. */
body.tg-app:not(.lima-felles-page) .bp-feedback {
  background: rgba(10, 23, 38, 0.72);
  border: 1px solid rgba(232, 238, 246, 0.16);
  border-radius: 12px;
  color: #e8eef6;
  box-shadow: none;
}

body.tg-app:not(.lima-felles-page) .bp-feedback .bp-icon {
  background: rgba(125, 206, 179, 0.22);
  color: #7dceb3;
  border-radius: 10px 0 0 10px;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.warning .bp-icon,
body.tg-app:not(.lima-felles-page) .bp-feedback.loading .bp-icon {
  background: rgba(224, 177, 90, 0.28);
  color: #f0d7a2;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.error .bp-icon {
  background: rgba(255, 107, 120, 0.22);
  color: #ffb4bc;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.success .bp-icon,
body.tg-app:not(.lima-felles-page) .bp-feedback.updated .bp-icon {
  background: rgba(125, 206, 179, 0.28);
  color: #b7f0dc;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.info,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.help {
  color: #e8eef6;
  background: rgba(125, 206, 179, 0.1);
  border: 1px solid rgba(125, 206, 179, 0.28);
  border-radius: 12px;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2 .bp-icon,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.info .bp-icon,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.help .bp-icon {
  background: transparent;
  color: #7dceb3;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.warning,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.loading {
  color: #f0d7a2;
  background: rgba(224, 177, 90, 0.12);
  border-color: rgba(224, 177, 90, 0.4);
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.warning .bp-icon,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.loading .bp-icon {
  color: #f0d7a2;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.error {
  color: #ffd0d4;
  background: rgba(255, 107, 120, 0.12);
  border-color: rgba(255, 107, 120, 0.4);
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.error .bp-icon {
  color: #ffb4bc;
}

body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.success,
body.tg-app:not(.lima-felles-page) .bp-feedback.bp-feedback-v2.updated {
  color: #d7fff0;
  background: rgba(125, 206, 179, 0.14);
  border-color: rgba(125, 206, 179, 0.4);
}

body.tg-app:not(.lima-felles-page) .bp-feedback p {
  color: inherit;
}

body.tg-app:not(.lima-felles-page) #buddypress .bb-bp-settings-content .bp-feedback,
body.tg-app:not(.lima-felles-page) .messages-screen .bp-messages-container .bp-feedback {
  background: rgba(10, 23, 38, 0.72);
  color: #e8eef6;
  border: 1px solid rgba(232, 238, 246, 0.16);
  border-radius: 12px;
}

body.tg-app:not(.lima-felles-page) .messages-screen .bp-messages-container .bp-feedback.info .bp-icon,
body.tg-app:not(.lima-felles-page) #buddypress .bb-bp-settings-content .bp-feedback.info .bp-icon {
  background: transparent;
  color: #7dceb3;
}

body.tg-app:not(.lima-felles-page) .messages-screen .bp-messages-container .bp-feedback.warning {
  background: rgba(224, 177, 90, 0.12);
  color: #f0d7a2;
  border-color: rgba(224, 177, 90, 0.4);
}

body.tg-app:not(.lima-felles-page) .messages-screen .bp-messages-container .bp-feedback.error {
  background: rgba(255, 107, 120, 0.12);
  color: #ffd0d4;
  border-color: rgba(255, 107, 120, 0.4);
}

body.tg-app:not(.lima-felles-page) .messages-screen .bp-messages-container .bp-feedback.success {
  background: rgba(125, 206, 179, 0.14);
  color: #d7fff0;
  border-color: rgba(125, 206, 179, 0.4);
}

body.tg-app.lima-profile-native .lima-profile--edit .bp-feedback.info,
body.tg-app.lima-profile-native .lima-profile--edit .bp-help-text,
body.tg-app.lima-profile-native .lima-profile--edit .editfield .description {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: rgba(224, 227, 236, 0.88);
  padding: 0;
}

/* Fluent Forms og feilskjema: mørk flate, lesbare alternativer i systemets lyse nedtrekk. */
body.tg-app .fluentform select.ff-el-form-control,
body.tg-app .tg-faults-inner select,
body.tg-app form select[name="locomotive_picker"],
body.tg-app:not(.lima-felles-page) .bp-settings-container select,
body.tg-app:not(.lima-felles-page) .lima-settings-chrome select {
  color: #e8eef6;
  background-color: rgba(10, 23, 38, 0.72);
  border: 1px solid rgba(232, 238, 246, 0.2);
  border-radius: 10px;
}

body.tg-app .fluentform select option,
body.tg-app .fluentform select optgroup,
body.tg-app .tg-faults-inner select option,
body.tg-app .tg-faults-inner select optgroup,
body.tg-app form select[name="locomotive_picker"] option,
body.tg-app:not(.lima-felles-page) .bp-settings-container select option,
body.tg-app:not(.lima-felles-page) .lima-settings-chrome select option,
body.tg-app.lima-profile-native select option {
  color: #0a1e32 !important;
  background-color: #ffffff !important;
}

body.tg-app .fluentform select option:checked,
body.tg-app .tg-faults-inner select option:checked,
body.tg-app form select[name="locomotive_picker"] option:checked,
body.tg-app:not(.lima-felles-page) .bp-settings-container select option:checked,
body.tg-app:not(.lima-felles-page) .lima-settings-chrome select option:checked,
body.tg-app.lima-profile-native select option:checked {
  color: #062016 !important;
  background-color: #d9f3ea !important;
}

/* Varsling og personvern: BuddyBoss bruker --bb-content-alternate-background-color (#010101) på rader. */
body.tg-app:not(.lima-felles-page) #buddypress .bb-bp-settings-content .main-notification-settings th,
body.tg-app:not(.lima-felles-page) #buddypress .bb-bp-settings-content .main-notification-settings td,
body.tg-app:not(.lima-felles-page) #buddypress .bb-bp-settings-content .main-notification-settings tr,
body.tg-app:not(.lima-felles-page) .buddypress-wrap .profile-settings tbody tr,
body.tg-app:not(.lima-felles-page) .buddypress-wrap .profile-settings tbody tr:nth-child(odd),
body.tg-app:not(.lima-felles-page) .buddypress-wrap .profile-settings tbody tr:hover,
body.tg-app:not(.lima-felles-page) .buddypress-wrap .profile-settings tbody tr.alt td {
  background: transparent;
  color: #e8eef6;
}

body.tg-app:not(.lima-felles-page) .buddypress-wrap .profile-settings thead tr {
  background: rgba(10, 23, 38, 0.72);
}

body.tg-app:not(.lima-felles-page) #buddypress .bb-bp-settings-content .main-notification-settings tbody tr,
body.tg-app:not(.lima-felles-page) .buddypress-wrap .profile-settings tbody tr {
  box-shadow: inset 0 -1px 0 rgba(232, 238, 246, 0.12);
}

body.tg-app:not(.lima-felles-page) .main-notification-settings .bb-mobile-setting .bb-mobile-setting-anchor {
  background: rgba(6, 16, 27, 0.7);
  color: #e8eef6;
  border: 1px solid rgba(232, 238, 246, 0.22);
  border-radius: 10px;
  padding: 8px 12px;
}

body.tg-app:not(.lima-felles-page) .main-notification-settings .bb-mobile-setting .bb-mobile-setting-anchor:after {
  color: #7dceb3;
}

body.tg-app:not(.lima-felles-page) .main-notification-settings .bb-mobile-setting ul {
  background: #0e1f33;
  border: 1px solid rgba(232, 238, 246, 0.22);
  color: #e8eef6;
  box-shadow: none;
}

body.tg-app:not(.lima-felles-page) .main-notification-settings .bb-mobile-setting ul li,
body.tg-app:not(.lima-felles-page) .main-notification-settings .bb-mobile-setting label {
  color: #e8eef6;
}

/* Varslingsbrytere. Samme avkrysning og notifications[nøkkel] som BuddyBoss lagrer. */
body.tg-app.lima-settings-native #buddypress .main-notification-settings {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings thead,
body.tg-app.lima-settings-native #buddypress .main-notification-settings tbody {
  display: block;
  width: 100%;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings tr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: transparent;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .notification_heading {
  display: block;
  margin-top: 14px;
  box-shadow: none;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .notification_heading td {
  display: block;
  padding: 8px 0 2px;
  color: #8ea3bb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings thead th,
body.tg-app.lima-settings-native #buddypress .main-notification-settings tbody td {
  display: flex;
  align-items: center;
  background: transparent;
  border: 0;
  color: #e8eef6;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings thead th.title,
body.tg-app.lima-settings-native #buddypress .main-notification-settings tbody td:first-child {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
  padding: 12px 12px 12px 0;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings thead th.email,
body.tg-app.lima-settings-native #buddypress .main-notification-settings thead th.web,
body.tg-app.lima-settings-native #buddypress .main-notification-settings thead th.app,
body.tg-app.lima-settings-native #buddypress .main-notification-settings tbody td.email,
body.tg-app.lima-settings-native #buddypress .main-notification-settings tbody td.web,
body.tg-app.lima-settings-native #buddypress .main-notification-settings tbody td.app {
  position: relative;
  display: flex;
  flex: 0 0 44px;
  justify-content: flex-end;
  width: 44px;
  min-width: 44px;
  padding: 0;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bb-mobile-setting {
  display: none !important;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox {
  position: absolute;
  width: 44px;
  height: 26px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox + label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  margin: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox + label:before {
  content: "" !important;
  position: absolute;
  inset: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(8, 16, 28, 0.92);
  border: 1px solid rgba(232, 238, 246, 0.28);
  box-shadow: none;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox + label:after {
  content: "" !important;
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8ea3bb;
  font-size: 0 !important;
  transform: none;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox:checked + label:before {
  background: #7dceb3;
  border-color: #7dceb3;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox:checked + label:after {
  background: #062016;
  transform: translateX(18px);
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox:focus-visible + label:before,
body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox:focus + label:before {
  outline: 2px solid #7dceb3;
  outline-offset: 3px;
}

body.tg-app.lima-settings-native #buddypress .main-notification-settings .bs-styled-checkbox:disabled + label,
body.tg-app.lima-settings-native #buddypress .main-notification-settings td.disabled .bs-styled-checkbox + label {
  opacity: 0.45;
  cursor: not-allowed;
}

body.tg-app:not(.lima-felles-page) #buddypress .standard-form select.bp-xprofile-visibility,
body.tg-app:not(.lima-felles-page) #buddypress .standard-form select.bp-xprofile-visibility:focus {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  min-height: 40px;
  padding: 8px 36px 8px 12px;
  background-color: rgba(6, 16, 27, 0.7);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path fill='none' stroke='%237dceb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 5.2 L7 9 L11 5.2'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  color: #e8eef6;
  border: 1px solid rgba(232, 238, 246, 0.22);
  border-radius: 10px;
}

body.tg-app .fluentform .ff-el-form-control:focus,
body.tg-app .tg-faults-inner select:focus,
body.tg-app .tg-faults-inner input:focus,
body.tg-app .tg-faults-inner textarea:focus,
body.tg-app:not(.lima-felles-page) .bp-settings-container select:focus,
body.tg-app:not(.lima-felles-page) .bp-settings-container input:focus,
body.tg-app:not(.lima-felles-page) .bp-settings-container textarea:focus {
  outline: 2px solid #7dceb3;
  outline-offset: 1px;
  border-color: #7dceb3;
}

body.tg-app .fluentform .ff-el-is-error .ff-el-form-control,
body.tg-app .fluentform .error .ff-el-form-control {
  border-color: #ff8b96;
}

body.tg-app .fluentform .error-text,
body.tg-app .fluentform .ff-el-is-error .error,
body.tg-app .fluentform .text-danger {
  color: #ffb4bc !important;
}

@media (max-width: 767px) {
  html:has(body.tg-has-header) {
    scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }
}
