/*
 * Tailwind compatibility layer.
 * These selectors keep the existing markup stable while the visual system uses
 * the app tokens plus Tailwind utilities.
 */

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

[hidden],
.d-none {
  display: none !important;
}

.container-xl {
  width: min(100% - 1.5rem, 1140px);
  margin-inline: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-inline: calc(var(--fb-gutter-x, 1rem) * -0.5);
  margin-top: calc(var(--fb-gutter-y, 1rem) * -1);
}

.row > * {
  width: 100%;
  max-width: 100%;
  padding-inline: calc(var(--fb-gutter-x, 1rem) * 0.5);
  margin-top: var(--fb-gutter-y, 1rem);
}

.g-3 {
  --fb-gutter-x: 1rem;
  --fb-gutter-y: 1rem;
}

@media (min-width: 768px) {
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
}

@media (min-width: 992px) {
  .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .d-lg-none { display: none !important; }
  .navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; }
  .navbar-expand-lg .navbar-toggler { display: none; }
  .navbar-expand-lg .navbar-nav { flex-direction: row; }
  .ms-lg-2 { margin-left: .5rem !important; }
  .mt-lg-0 { margin-top: 0 !important; }
  .py-lg-5 { padding-block: 3rem !important; }
  .gap-lg-1 { gap: .25rem !important; }
  .align-items-lg-center { align-items: center !important; }
}

.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-inline-block { display: inline-block !important; }
.vstack { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.ms-auto { margin-left: auto !important; }
.me-2 { margin-right: .5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.py-2 { padding-block: .5rem !important; }
.py-4 { padding-block: 1.5rem !important; }
.p-3 { padding: 1rem !important; }
.small { font-size: .875rem !important; }
.h4 { font-size: 1.5rem; line-height: 1.25; }
.h6 { font-size: 1rem; line-height: 1.25; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-black { font-weight: 900 !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-muted { color: var(--ng-text-muted) !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded { border-radius: .5rem !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar {
  display: flex;
  align-items: center;
  min-height: 4.25rem;
}

.navbar > .container-xl,
.navbar > .container {
  display: flex;
  flex-wrap: inherit;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

.navbar-collapse:not(.show) {
  display: none;
}

.navbar-collapse.collapse,
.accordion-collapse.collapse {
  visibility: visible;
}

@media (min-width: 992px) {
  .navbar-ng > .container-xl {
    width: 100%;
    max-width: none;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    visibility: visible !important;
    min-width: 0;
  }

  .navbar-expand-lg .navbar-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  .navbar-account-slot {
    flex: 0 0 auto;
  }
}

.navbar-nav {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
}

.navbar-toggler {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: .75rem;
  border: 1px solid var(--ng-border);
  background: var(--ng-bg-soft);
  color: var(--ng-text);
}

.navbar-toggler-icon {
  width: 1.1rem;
  height: .85rem;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.navbar-toggler-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px solid currentColor;
  transform: translateY(-50%);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ng-text);
  background: var(--ng-card-bg, var(--ng-bg-soft));
  border: 1px solid var(--ng-border);
  border-radius: .75rem;
}

.card-body { flex: 1 1 auto; padding: 1rem; }
.card-header {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--ng-border);
}

.list-group-item {
  display: block;
  padding: .75rem 0;
  border-bottom: 1px solid var(--ng-border);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.6rem;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  font: inherit;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.btn-sm {
  min-height: 2.15rem;
  padding: .45rem .65rem;
  font-size: .875rem;
}

.btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  border-radius: 0;
}

.btn-group > .btn:first-child {
  border-top-left-radius: .5rem;
  border-bottom-left-radius: .5rem;
}

.btn-group > .btn:last-child {
  border-top-right-radius: .5rem;
  border-bottom-right-radius: .5rem;
}

.btn-group-sm > .btn {
  min-height: 2.15rem;
  padding: .45rem .65rem;
  font-size: .875rem;
}

.form-label {
  display: block;
  margin-bottom: .5rem;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: .65rem .8rem;
  color: var(--ng-text);
  background: var(--ng-input-bg, var(--ng-bg-soft));
  border: 1px solid var(--ng-border);
  border-radius: .5rem;
  font: inherit;
}

.form-control-sm,
.form-select-sm {
  min-height: 2.35rem;
  padding: .5rem .65rem;
  font-size: .925rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ng-accent-orange) 72%, transparent);
  outline-offset: 2px;
}

.form-control:disabled,
.form-select:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.form-text {
  display: block;
  margin-top: .35rem;
  font-size: .875rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--ng-accent-orange);
}

.form-check-label {
  margin: 0;
}

.alert {
  padding: .85rem 1rem;
  border-radius: .6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  padding: .75rem;
  border-bottom: 1px solid var(--ng-border);
}

.align-middle {
  vertical-align: middle !important;
}

.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  display: none;
}

.dropdown-menu {
  position: absolute;
  z-index: 1050;
  display: none;
  min-width: 13rem;
  padding: .45rem;
  margin: .35rem 0 0;
  color: var(--ng-text);
  background: var(--ng-card-bg, var(--ng-bg-soft));
  border: 1px solid var(--ng-border);
  border-radius: .75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .28);
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu-end {
  right: 0;
  left: auto;
}

.dropdown-item,
.dropdown-header {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .5rem;
  padding: .55rem .65rem;
  color: var(--ng-text);
  text-decoration: none;
  border-radius: .45rem;
  background: transparent;
  border: 0;
  text-align: left;
}

.dropdown-item {
  cursor: pointer;
}

.dropdown-divider {
  height: 1px;
  margin: .35rem 0;
  background: var(--ng-border);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  background: transparent;
}

.modal.show {
  display: block;
}

.modal-dialog {
  position: relative;
  width: min(100%, 520px);
  margin: 1.75rem auto;
  pointer-events: none;
}

.modal-sm {
  width: min(100%, 420px);
}

.modal-dialog-centered {
  min-height: calc(100% - 3.5rem);
  display: flex;
  align-items: center;
}

.modal-content {
  width: 100%;
  pointer-events: auto;
  background: var(--ng-card-bg, var(--ng-bg-soft));
  border: 1px solid var(--ng-border);
  border-radius: .8rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--ng-border);
}

.modal-body {
  padding: 1rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(2, 6, 23, .7);
  backdrop-filter: blur(6px);
}

.modal-open {
  overflow: hidden;
}

.btn-close {
  appearance: none;
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ng-border);
  border-radius: .5rem;
  background: var(--ng-bg-soft);
  color: var(--ng-text);
  cursor: pointer;
}

.btn-close::before {
  content: "x";
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.collapse:not(.show) {
  display: none;
}

.simbrief-fetch-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--ng-border);
  border-radius: .75rem;
  background: color-mix(in srgb, var(--ng-bg-soft) 88%, transparent);
}

.simbrief-fetch-copy strong {
  display: block;
  font-size: 1rem;
  margin-bottom: .25rem;
}

.simbrief-fetch-actions {
  display: grid;
  gap: .65rem;
}

.simbrief-fetch-actions .btn {
  width: 100%;
}

.simbrief-fetch-actions {
  align-items: stretch;
}

@media (min-width: 640px) {
  .simbrief-fetch-panel {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .simbrief-fetch-actions {
    grid-template-columns: auto;
    justify-content: end;
  }
}

.home-timetable-feature {
  margin-top: 0.85rem;
}

.home-timetable-feature .guide.ng-card {
  border-radius: 0;
  border-inline: 0;
  box-shadow: none;
}

.home-timetable-feature .page-shell-header {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.home-timetable-feature .page-lead {
  max-width: 42rem;
  margin-bottom: 0;
  font-size: 0.92rem;
}

body.is-briefing-route .home-timetable-feature {
  display: none !important;
}

html,
body {
  margin: 0;
}

main.fb-app-main.container-xl {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 0 !important;
}

main.fb-app-main .page-view,
main.fb-app-main .content-page,
main.fb-app-main .briefing-shell,
main.fb-app-main .content-page .guide.ng-card {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
