html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Airport names may wrap independently of their ICAO code and flag. */
.airport-label { display: inline-grid; grid-template-columns: minmax(0, 1fr) minmax(0, .45fr); gap: .25rem .75rem; align-items: start; max-width: 100%; vertical-align: top; }
.airport-city { grid-column: 1; grid-row: 1; }
.airport-name { grid-column: 1; grid-row: 2; }
.airport-country { display: contents; }
.airport-country img { grid-column: 2; grid-row: 1; align-self: center; justify-self: end; }
.airport-country-name { grid-column: 2; grid-row: 2; font-size: .85em; line-height: 1.4; font-weight: 400; color: #536375; text-align: right; overflow-wrap: anywhere; }
.airport-city { overflow-wrap: anywhere; font-weight: 600; }
.airport-name { overflow-wrap: anywhere; }
.table td, .table th { overflow-wrap: anywhere; }
.mobile-field-label { display: none; }
.badge { white-space: normal; text-align: start; line-height: 1.4; }

@media (max-width: 767.98px) {
  html { font-size: 16px; }
  main { min-width: 0; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  .card-body.p-4 { padding: 1rem !important; }
  .btn, .navbar-toggler { min-height: 44px; }
  input, select, textarea { max-width: 100%; }
  #flight-track-map, #journal-map { height: 360px !important; height: min(60svh, 420px) !important; min-height: 280px; }
  .mobile-cards, .mobile-cards tbody { display: block; width: 100%; }
  /* Visually hide headers while preserving their accessible table associations. */
  .mobile-cards thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-cards caption { display: block; padding: .5rem 0; }
  .mobile-cards tbody tr { display: block; margin-bottom: 1rem; border: 1px solid #dee2e6; border-radius: .75rem; padding: .5rem 1rem; background: #fff; }
  .mobile-cards.table > tbody > tr > td { display: block; width: 100%; padding: .5rem 0; border: 0; box-shadow: none; background: transparent; }
  .mobile-cards.table > tbody > tr > td + td { border-top: 1px solid #f0f1f3; }
  .mobile-field-label { display: block; font-size: .75rem; font-weight: 600; color: #59616a; margin-bottom: .15rem; }
  .mobile-cards .airport-label { display: grid; margin: .15rem 0; }
  .mobile-cards form { max-width: 100%; }
  .mobile-cards td .btn { margin: .2rem .2rem .2rem 0; }
  .footer { position: static !important; white-space: normal !important; line-height: 1.6 !important; padding: 1rem 0; }
  body { margin-bottom: 0; }
}


.flight-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .85rem; }
.flight-item { border: 1px solid #dfe6ed; border-radius: 14px; background: #fff; overflow: hidden; }
.flight-item-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; padding: .7rem 1rem; background: #f5f8fb; font-size: .85rem; color: #536375; }
.flight-item-heading strong { color: #24364b; }
.flight-route { display: grid; grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr); gap: .75rem; padding: 1rem; }
.flight-stop { min-width: 0; }
.flight-stop-label { display: block; font-size: .7rem; color: #637286; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.flight-route .airport-label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .45fr); align-items: start; gap: .25rem .75rem; width: 100%; }
.flight-route .airport-city { font-size: 1.2rem; line-height: 1.25; color: #193652; grid-column: 1; grid-row: 1; }
.flight-route .airport-name { grid-column: 1; grid-row: 2; font-size: .85rem; color: #536375; line-height: 1.4; }
.flight-route-arrow { align-self: start; margin-top: 1.3rem; text-align: center; color: #8096aa; font-size: 1.5rem; }
.flight-clock { font-size: 1.35rem; font-weight: 650; color: #24364b; margin-top: .6rem; font-variant-numeric: tabular-nums; }
.flight-utc, .flight-arrival-date { display: block; font-size: .75rem; color: #637286; }
.flight-details { padding: 0 1rem .5rem; }
.flight-details summary { width: fit-content; min-height: 36px; padding: .4rem 0; color: #4a6580; font-size: .8rem; cursor: pointer; }
.flight-details dl { border-top: 1px solid #e8edf2; padding-top: .7rem; display: grid; grid-template-columns: minmax(6rem, 1fr) 2fr; gap: .4rem .7rem; font-size: .85rem; }
.flight-details dd { margin: 0; overflow-wrap: anywhere; }
.flight-list { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 380px) { .flight-route { gap: .4rem; grid-template-columns: minmax(0, 1fr) 1rem minmax(0, 1fr); padding: .8rem; } .flight-item-heading { padding: .6rem .8rem; } }


/* Share row heights across both stops, including arbitrarily long airport names. */
.flight-route { grid-template-rows: auto auto auto auto auto; row-gap: 0; }
.flight-stop { display: grid; grid-template-rows: subgrid; grid-row: 1 / 6; }
.flight-stop:first-child { grid-column: 1; }
.flight-stop:last-child { grid-column: 3; }
.flight-stop > .flight-stop-label { grid-row: 1; }
.flight-stop > .airport-label { grid-row: 2; align-self: start; }
.flight-stop > .flight-clock { grid-row: 3; }
.flight-stop > .flight-utc { grid-row: 4; }
.flight-stop > .flight-arrival-date { grid-row: 5; }
.flight-route-arrow { grid-column: 2; grid-row: 1 / 6; }

/* Give each airport the full width of its stop on phones. Country information
   belongs below the name, rather than squeezing it into a second narrow column. */
@media (max-width: 575.98px) {
  .flight-route { grid-template-rows: auto auto auto auto auto auto auto; }
  .flight-stop { grid-row: 1 / 8; }
  .flight-route-arrow { grid-row: 1 / 8; }
  .flight-stop > .airport-label { grid-row: 2 / 5; align-self: stretch; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); }
  .flight-stop > .flight-clock { grid-row: 5; }
  .flight-stop > .flight-utc { grid-row: 6; }
  .flight-stop > .flight-arrival-date { grid-row: 7; }
  .flight-route .airport-city { overflow-wrap: normal; word-break: normal; hyphens: none; }
  .flight-route .airport-name { overflow-wrap: break-word; word-break: normal; }
  .flight-route .airport-country { display: flex; grid-column: 1; grid-row: 3; align-items: center; align-self: start; gap: .35rem; min-width: 0; margin-top: .3rem; }
  .flight-route .airport-country img { flex: 0 0 24px; width: 24px; height: 18px; }
  .flight-route .airport-country-name { min-width: 0; text-align: left; font-size: .8rem; overflow-wrap: break-word; word-break: normal; }
}


.year-calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.calendar-month { padding: 1rem; border: 1px solid #dfe6ed; border-radius: 12px; background: white; }
.calendar-month h2 { font-size: 1.05rem; margin: 0 0 1rem; }
.month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.weekday { text-align: center; font-size: .75rem; color: #637286; padding-bottom: .4rem; }
.calendar-day { position: relative; display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 2px; border: 1px solid transparent; border-radius: 6px; background: #f5f6f8; color: #334155; font-size: .85rem; font-variant-numeric: tabular-nums; }
button.calendar-day:hover { outline: 2px solid #334155; }
button.calendar-day:focus-visible { outline: 3px solid #111; outline-offset: 1px; }
.calendar-day small { position: absolute; right: 2px; bottom: 0; font-size: .55rem; }
.work-color-0 { background: #d8eaff; color: #143e70; border-color: #94bce8; }
.work-color-1 { background: #d4f1dd; color: #18552d; border-color: #86c79b; }
.work-color-2 { background: #ffe4be; color: #713d08; border-color: #e4af65; }
.work-color-3 { background: #e9dfff; color: #50307d; border-color: #bba1e4; }
.work-color-4 { background: #ffdaea; color: #7e244b; border-color: #e8a0bd; }


.home-aircraft { display: block; width: 100%; height: auto; max-height: 440px; object-fit: contain; background: #ececec; border-radius: 14px; }

.notifications-page { max-width: 1040px; margin: 0 auto; }
.notification-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #536b83; }
.notification-preview-note { padding: .9rem 1rem; background: #edf4fb; border-left: 3px solid #5282ad; border-radius: 4px 10px 10px 4px; color: #304b65; }
.notification-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.notification-panel { padding: 1.5rem; border: 1px solid #dfe6ed; border-radius: 14px; background: #fff; min-width: 0; }
.notification-example { background: #f5f8fb; }
.notification-choice { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem; border: 1px solid #dfe6ed; border-radius: 10px; margin-top: .75rem; cursor: pointer; }
.notification-choice:has(input:checked) { border-color: #9ebcda; background: #f5f9fd; }
.notification-choice input { flex-shrink: 0; }
.notification-choice small { display: block; margin-top: .25rem; color: #637286; }
.notification-example-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .75rem; border-top: 1px solid #dfe6ed; padding-top: 1.25rem; margin-top: 1.5rem; }
.notification-example-route small, .notification-example-route strong, .notification-example-route span span { display: block; }
.notification-example-route small { font-size: .65rem; color: #637286; letter-spacing: .08em; }
.notification-example-route strong { font-size: 1.2rem; color: #24364b; }
.notification-example-route span span { font-size: .8rem; color: #637286; }
@media (max-width: 767.98px) { .notification-grid { grid-template-columns: minmax(0, 1fr); } .notification-panel { padding: 1.1rem; } }
