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 typeahead (Index page) */
.airport-lookup { position: relative; }
.airport-lookup .lookup-results {
  position: absolute; left: 0; right: 0; z-index: 1000;
  max-height: 20rem; overflow-y: auto;
}
.airport-lookup .lookup-results .list-group-item { text-align: left; }
.airport-lookup .lookup-results .list-group-item strong { display: inline-block; min-width: 3.2em; }


/* G2: per-box data-source note – small, green, collapsed by default */
.datasource { margin-top: .75rem; font-size: .78rem; }
.datasource > summary { display: inline-block; cursor: pointer; background: #e3f4e6; color: #1c5a2c; border: 1px solid #b9dfc0; border-radius: 4px; padding: .15rem .5rem; list-style: none; }
.datasource > summary::-webkit-details-marker { display: none; }
.datasource > summary::before { content: "▸ "; }
.datasource[open] > summary::before { content: "▾ "; }
.datasource > div { background: #e3f4e6; color: #1c5a2c; border: 1px solid #b9dfc0; border-radius: 0 4px 4px 4px; padding: .4rem .6rem; margin-top: -1px; }

/* S1: when box */
.when-box { display: flex; flex-wrap: wrap; gap: .5rem; }
.when-opt { border: 1px solid #ced4da; border-radius: 6px; padding: .45rem .8rem; cursor: pointer; background: #fff; }
.when-opt:has(input:checked) { border-color: #FFBA00; background: #fff7e0; }
.when-opt input { margin-right: .35rem; }

/* R1–R5: tappable flight rows, phone-first */
.flight-list { display: flex; flex-direction: column; gap: .4rem; }
.flight-row { display: grid; grid-template-columns: 4.2rem 3.2rem 1fr auto; gap: .5rem .7rem; align-items: center;
  padding: .55rem .7rem; border: 1px solid #d9dee6; border-radius: 8px; background: #fff; color: inherit; text-decoration: none; }
.flight-row:hover { border-color: #FFBA00; background: #fffaf0; color: inherit; }
.flight-row-gone { opacity: .55; }
.fr-time { line-height: 1.1; } .fr-time s { display: block; }
.fr-logo img { width: 3.2rem; height: auto; max-height: 1.6rem; object-fit: contain; }
.fr-dest { font-size: .9rem; color: #445; }
.fr-status { text-align: right; white-space: nowrap; }
.st { display: inline-block; font-size: .75rem; padding: .15rem .45rem; border-radius: 4px; background: #e9ecef; color: #333; }
.st-go { background: #d9f0dd; color: #1c5a2c; } .st-warn { background: #fff3cd; color: #6d4c00; } .st-bad { background: #f8d7da; color: #842029; } .st-gone { background: #e2e3e5; color: #555; }
@media (max-width: 480px) {
  .flight-row { grid-template-columns: 3.6rem 1fr auto; }
  .fr-logo { display: none; }
  .fr-status small { display: none !important; }
}


/* Dark mode: Bootstrap 5.3 handles its own components via data-bs-theme; these cover our custom pieces. */
[data-bs-theme="dark"] body { background: #14171c; color: #dfe3ea; }
[data-bs-theme="dark"] .datasource > summary, [data-bs-theme="dark"] .datasource > div { background: #1f3a26; color: #b9e2c2; border-color: #2f5b3a; }
[data-bs-theme="dark"] .when-opt { background: #1c2129; border-color: #3a414d; }
[data-bs-theme="dark"] .when-opt:has(input:checked) { background: #3a2f10; border-color: #FFBA00; }
[data-bs-theme="dark"] .flight-row { background: #1c2129; border-color: #3a414d; color: #dfe3ea; }
[data-bs-theme="dark"] .flight-row:hover { background: #2a2410; }
[data-bs-theme="dark"] .fr-dest { color: #aab2c0; }
[data-bs-theme="dark"] .fr-logo img { background: #fff; border-radius: 3px; padding: 2px; }
[data-bs-theme="dark"] .st { background: #2c333d; color: #dfe3ea; }
[data-bs-theme="dark"] .airport-lookup .lookup-results { background: #1c2129; }

/* Plain-language explainer per box – blue, collapsed by default, sits above the data-source note */
.explainer { margin-top: .75rem; font-size: .85rem; }
.explainer > summary { display: inline-block; cursor: pointer; background: #e4eefb; color: #1f3f77; border: 1px solid #b7cdee; border-radius: 4px; padding: .15rem .55rem; list-style: none; }
.explainer > summary::-webkit-details-marker { display: none; }
.explainer > summary::before { content: "▸ "; }
.explainer[open] > summary::before { content: "▾ "; }
.explainer > div { background: #eef4fc; color: #1f2f4d; border: 1px solid #b7cdee; border-radius: 0 4px 4px 4px; padding: .5rem .7rem; margin-top: -1px; line-height: 1.45; }
.explainer > div p { margin: 0 0 .4rem; } .explainer > div p:last-child { margin: 0; }
[data-bs-theme="dark"] .explainer > summary, [data-bs-theme="dark"] .explainer > div { background: #1c2a40; color: #c7d7f2; border-color: #2f4a73; }
.api-table td, .api-table th { font-size: .8rem; }
.api-url { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }

/* Compact search boxes side by side on desktop (stack on phones via col-sm) */
.airport-lookup .form-control { font-size: 1rem; }

/* Loading interstitial */
.hourglass { font-size: 2.4rem; line-height: 1; animation: flip 2.2s ease-in-out infinite; display: inline-block; }
@keyframes flip { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
.loading-steps { padding-left: 1.2rem; margin: .6rem 0; }
.loading-steps li { padding: .18rem 0; color: #667; transition: color .3s; }
.loading-steps li.busy { color: #1f2f4d; font-weight: 600; }
.loading-steps li.busy::after { content: " …"; }
.loading-steps li.done { color: #1c5a2c; font-weight: 400; }
.loading-steps li.done::after { content: " ✓"; }
[data-bs-theme="dark"] .loading-steps li { color: #aab2c0; } [data-bs-theme="dark"] .loading-steps li.busy { color: #e6e9ef; } [data-bs-theme="dark"] .loading-steps li.done { color: #b9e2c2; }

/* About page */
.about-page { max-width: 1000px; margin: 0 auto; }
.sources-table td, .sources-table th { font-size: .86rem; vertical-align: top; }
.diagram-wrap { background: #fff; border: 2px solid #8a94a6; border-radius: 8px; padding: .5rem; overflow-x: auto; }
.diagram-wrap .mermaid { margin: 0; }
[data-bs-theme="dark"] .diagram-wrap { background: #1c2129; border-color: #4a5364; }
