@font-face {
  font-family: system;
  src: local("Segoe UI");
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f5f8;
  color: #172031;
  font:
    16px/1.5 system,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: #405aca;
}
button {
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #788fff;
  outline-offset: 3px;
}
.shell {
  max-width: 1440px;
  margin: auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}
.sidebar {
  padding: 34px 24px;
  border-right: 1px solid #dfe3eb;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand img {
  width: 34px;
}
.sidebar small,
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #697388;
}
.nav {
  display: grid;
  gap: 8px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  text-align: left;
  color: #657087;
  padding: 13px 14px;
  border-radius: 12px;
  font-weight: 600;
}
.nav button.active {
  background: #e7ecfc;
  color: #334bab;
}
.nav svg {
  width: 20px;
  height: 20px;
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-bottom button {
  margin: 6px 0;
  width: 100%;
  text-align: left;
}
.side-note {
  border-top: 1px solid #e0e5ee;
  padding-top: 20px;
  color: #727d90;
  font-size: 13px;
}
.content {
  padding: 30px 42px 60px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
  color: #6e7789;
  font-size: 14px;
}
.top-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #e8edf5;
  border-radius: 30px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 650;
  color: #526176;
}
.pill.green {
  background: #e3f3e9;
  color: #21623f;
}
.pill.amber {
  background: #fff1d6;
  color: #805500;
}
.pill.blue {
  background: #e6ebff;
  color: #455ebe;
}
.btn {
  background: white;
  border: 1px solid #dfe4ed;
  color: #354056;
  padding: 9px 15px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.btn svg {
  width: 17px;
  height: 17px;
}
.btn.primary {
  color: white;
  background: #29395f;
  border-color: #29395f;
}
.btn.ghost {
  background: transparent;
  border: 0;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
h1 {
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -1.3px;
  margin: 7px 0 8px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
p {
  margin: 8px 0;
}
.muted {
  color: #707b8e;
}
.small {
  font-size: 13px;
}
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(245px, 1fr);
  gap: 22px;
}
.card {
  background: white;
  border: 1px solid #e1e5ed;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 18px #202b4204;
}
.pad {
  padding: 24px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 21px 24px;
}
.flight-number {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
}
.airline-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  background: #22314e;
  color: white;
  border-radius: 50%;
}
.map {
  height: 220px;
  position: relative;
  background: #e9eef5;
  overflow: hidden;
}
.map svg {
  width: 100%;
  height: 100%;
}
.map-caption {
  position: absolute;
  bottom: 10px;
  left: 16px;
  font-size: 12px;
  color: #626f85;
  background: #ffffffb8;
  padding: 3px 8px;
  border-radius: 8px;
}
.route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 14px;
  gap: 10px;
}
.airport {
  font-size: 48px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -2px;
}
.airport-name {
  font-size: 13px;
  color: #6f7a8d;
  margin-top: 6px;
}
.route-center {
  text-align: center;
  color: #8b95a8;
  font-size: 13px;
}
.route-center svg {
  width: 25px;
  height: 25px;
}
.route-right {
  text-align: right;
}
.times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 28px 20px;
}
.times strong {
  font-size: 24px;
  letter-spacing: -0.7px;
}
.times small {
  display: block;
  color: #717c90;
  font-size: 12px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fafbfd;
  border-top: 1px solid #ecedf3;
  padding: 18px 12px;
}
.fact {
  text-align: center;
  border-right: 1px solid #e8ebf2;
}
.fact:last-child {
  border: 0;
}
.fact span {
  display: block;
  color: #6d788a;
  font-size: 12px;
}
.fact strong {
  font-size: 20px;
}
.freshness {
  padding: 12px 24px;
  border-top: 1px solid #eceff5;
  font-size: 12px;
  color: #69778a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.countdown {
  font-size: 41px;
  letter-spacing: -2px;
  font-weight: 650;
  line-height: 1.2;
  margin: 17px 0;
}
.countdown small {
  font-size: 20px;
  letter-spacing: 0;
  color: #758097;
}
.progress {
  height: 5px;
  background: #e7ecf5;
  border-radius: 5px;
  overflow: hidden;
  margin: 18px 0;
}
.progress div {
  height: 100%;
  background: #798fed;
}
.live-card {
  background: #141b28;
  color: #eef1ff;
  padding: 23px;
  border-radius: 20px;
  box-shadow: 0 6px 24px #17223d12;
}
.live-card p {
  color: #a8b2c7;
}
.live-card .eyebrow {
  color: #9daac6;
}
.island {
  margin: 18px auto;
  background: #030509;
  border-radius: 35px;
  padding: 12px 18px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: #c1d1ff;
}
.info-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  font-size: 14px;
}
.divider {
  height: 1px;
  background: #e7eaf0;
  margin: 18px 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 15px;
}
.section-head h2 {
  margin: 0;
}
.travel-row {
  padding: 19px 22px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.travel-row + .travel-row {
  border-top: 1px solid #edf0f5;
}
.travel-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eef1fa;
  display: grid;
  place-items: center;
  color: #6779b3;
  flex-shrink: 0;
}
.travel-icon svg {
  height: 22px;
  width: 22px;
}
.row-body {
  flex: 1;
  min-width: 0;
}
.row-body strong {
  display: block;
}
.row-end {
  text-align: right;
}
.text-link {
  background: none;
  color: #425cbf;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}
.banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff3d9;
  color: #785720;
  font-size: 13px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.empty {
  padding: 48px 30px;
  text-align: center;
}
.empty svg {
  width: 40px;
  height: 40px;
  color: #7186ca;
  margin-bottom: 10px;
}
.empty p {
  color: #737d90;
  max-width: 440px;
  margin: 10px auto 22px;
}
.timeline {
  position: relative;
  margin-top: 24px;
}
.day-label {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 28px 0 15px;
}
.day-stamp {
  width: 48px;
  height: 56px;
  background: #e7ecfc;
  border-radius: 12px;
  text-align: center;
  padding-top: 5px;
  line-height: 1.3;
}
.day-stamp small {
  font-size: 11px;
  color: #5267a0;
}
.day-stamp strong {
  display: block;
  font-size: 23px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 16px;
  margin: 0 0 13px;
}
.timeline-time {
  font-size: 14px;
  color: #647086;
  padding-top: 20px;
}
.timeline .travel-row {
  border-left: 3px solid #8497dd;
}
.trip-cover {
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(120deg, #23324c, #52698a);
  color: white;
}
.trip-cover .eyebrow {
  color: #b7c5e2;
}
.trip-cover h2 {
  font-size: 32px;
}
.paper {
  background: #fffefa;
  border: 1px solid #e1e2df;
  padding: 28px 30px;
  border-radius: 4px;
}
.paper-meta {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #263445;
  padding-bottom: 11px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.masthead {
  font-family: Georgia, serif;
  font-size: 53px;
  letter-spacing: -2px;
  text-align: center;
  font-weight: 700;
  margin: 16px 0 13px;
  line-height: 1.15;
}
.paper-sub {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1.5px;
  border-bottom: 3px double #34404b;
  padding-bottom: 15px;
  text-transform: uppercase;
}
.paper-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 25px;
  margin-top: 23px;
}
.paper h2 {
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.7px;
}
.paper h3 {
  font-family: Georgia, serif;
  font-size: 22px;
}
.paper article {
  border-bottom: 1px solid #dadfdc;
  padding: 18px 0;
}
.paper article:first-child {
  padding-top: 0;
}
.paper .aside {
  border-left: 1px solid #d9dedb;
  padding-left: 24px;
}
.paper p {
  color: #586170;
  font-size: 15px;
  line-height: 1.65;
}
.destination-photo {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 3px;
  filter: saturate(0.7);
}
.source {
  font-size: 12px;
  color: #657593;
  margin-top: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #5a6578;
  margin: 12px 0;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  background: white;
  color: #1b263d;
  border: 1px solid #d9dfeb;
  border-radius: 9px;
  min-width: 0;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 15px;
}
.full {
  grid-column: 1/-1;
}
dialog {
  padding: 0;
  border: 1px solid #dce1eb;
  border-radius: 20px;
  width: min(650px, calc(100vw - 30px));
  max-height: 90vh;
  color: #172031;
  box-shadow: 0 25px 100px #06112940;
}
dialog::backdrop {
  background: #121a32a0;
  backdrop-filter: blur(4px);
}
.modal-content {
  padding: 26px;
}
.modal-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title h2 {
  margin: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 30% 20%, #273b61, #101722 70%);
  padding: 20px;
}
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  padding: 35px;
  border-radius: 23px;
}
.auth-card .brand {
  margin-bottom: 25px;
}
.auth-card .btn {
  width: 100%;
  margin-top: 15px;
}
.error {
  color: #a93137;
  font-size: 14px;
}
.mobile-only {
  display: none;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  border-radius: 12px;
  padding: 14px 22px;
  background: #17243c;
  color: #fff;
  box-shadow: 0 8px 30px #18223833;
  display: none;
  z-index: 20;
}
.hidden {
  display: none !important;
}
.checkline {
  display: flex;
  gap: 10px;
  align-items: center;
}
.checkline input {
  width: auto;
}
.offline-strip {
  background: #25344f;
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
}
.badge-label {
  font-size: 12px;
  color: #56677d;
}
.scroll-select {
  max-width: 240px;
}
.board-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.status-row {
  padding: 12px 0;
  border-bottom: 1px solid #e8ebf2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.status-row:last-child {
  border: 0;
}
.note {
  border-left: 3px solid #a7b7e6;
  padding-left: 12px;
  font-size: 14px;
  color: #6f7990;
}
.date-controls {
  display: flex;
  gap: 10px;
}
.date-controls input {
  width: 160px;
}
@media (min-width: 1500px) {
  .shell {
    border-left: 1px solid #e1e5ed;
    border-right: 1px solid #e1e5ed;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 180px 1fr;
  }
  .sidebar {
    padding: 30px 16px;
  }
  .content {
    padding: 26px;
  }
  .main-grid {
    grid-template-columns: 1fr;
  }
  .stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .map {
    height: 240px;
  }
  .paper-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #dce2ed;
    background: #fffffff2;
    backdrop-filter: blur(15px);
  }
  .sidebar > .brand,
  .sidebar > small,
  .sidebar-bottom {
    display: none;
  }
  .nav {
    display: flex;
    justify-content: space-around;
    gap: 0;
  }
  .nav button {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    padding: 7px 5px;
    border-radius: 9px;
  }
  .nav button svg {
    width: 22px;
    height: 22px;
  }
  .content {
    padding: 20px 16px 110px;
  }
  .topbar {
    margin-bottom: 23px;
  }
  .top-actions .btn span {
    display: none;
  }
  .page-heading {
    align-items: center;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .main-grid {
    gap: 17px;
  }
  .stack {
    display: flex;
    gap: 16px;
  }
  .map {
    height: 200px;
  }
  .airport {
    font-size: 44px;
  }
  .route {
    padding: 22px 22px 15px;
  }
  .times {
    padding: 0 22px 20px;
  }
  .facts {
    padding: 15px 8px;
  }
  .fact strong {
    font-size: 19px;
  }
  .pad {
    padding: 21px;
  }
  .paper {
    padding: 20px 18px;
  }
  .masthead {
    font-size: 39px;
  }
  .paper-grid {
    display: block;
  }
  .paper .aside {
    border: 0;
    padding: 20px 0 0;
  }
  .paper h2 {
    font-size: 28px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .row-end {
    font-size: 13px;
  }
  .travel-row {
    padding: 17px;
  }
  .date-controls {
    flex-wrap: wrap;
  }
  .date-controls input {
    width: 140px;
  }
  .paper-meta {
    font-size: 10px;
  }
  .banner {
    align-items: flex-start;
  }
  .mobile-only {
    display: inline-flex;
  }
  .scroll-select {
    max-width: 160px;
  }
  .topbar > span {
    font-size: 12px;
  }
  .timeline-row {
    grid-template-columns: 60px 1fr;
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (min-width: 701px) {
  .nav .mobile-only {
    display: none;
  }
}
.airline-mark svg {
  width: 23px;
  height: 23px;
}
.card-head > .flight-number {
  flex: 1;
}
.airport {
  overflow-wrap: anywhere;
}
.map svg {
  display: block;
}
.nonflight .airport {
  font-size: 26px;
  letter-spacing: -0.7px;
  max-width: 180px;
}
.map img {
  display: block;
}
.info-line strong {
  overflow-wrap: anywhere;
  max-width: 65%;
}
.info-line span {
  overflow-wrap: anywhere;
}

/* Explicit night palette keeps maps, controls and newspaper pages legible. */
html[data-theme="night"] { color-scheme: dark; }
html[data-theme="day"] { color-scheme: light; }
html[data-theme="night"] body { background:#101722;color:#e4eaf4; }
html[data-theme="night"] .sidebar { background:#141d2b;border-color:#324059; }
html[data-theme="night"] .card,html[data-theme="night"] dialog,html[data-theme="night"] .auth-card { background:#1c2738;color:#e4eaf4;border-color:#35445e; }
html[data-theme="night"] .btn,html[data-theme="night"] input,html[data-theme="night"] select,html[data-theme="night"] textarea { background:#172235;color:#e4eaf4;border-color:#43516b; }
html[data-theme="night"] .btn.primary { background:#aebeff;color:#152039;border-color:#aebeff; }
html[data-theme="night"] .paper { background:#1b2531;color:#e6e7e5;border-color:#4b5564; }
html[data-theme="night"] .muted,html[data-theme="night"] .eyebrow,html[data-theme="night"] .source,html[data-theme="night"] label,html[data-theme="night"] .paper-sub,html[data-theme="night"] .side-note { color:#adbbd0; }
html[data-theme="night"] a,html[data-theme="night"] .text-link { color:#b7c7ff; }
html[data-theme="night"] .pill { background:#2b3a53;color:#d3dff3; }
html[data-theme="night"] .pill.green { background:#204837;color:#b6e9c7; }
html[data-theme="night"] .pill.amber,html[data-theme="night"] .note,html[data-theme="night"] .banner { background:#433520;color:#f5d995; }
html[data-theme="night"] .nav button { color:#b5c3da; }
html[data-theme="night"] .nav button.active { background:#303f66;color:#dfe5ff; }
html[data-theme="night"] .flight-footer,html[data-theme="night"] .card-footer,html[data-theme="night"] .map { background:#243044;color:#cfdaed; }
html[data-theme="night"] .airport-name,html[data-theme="night"] .flight-meta,html[data-theme="night"] .small,html[data-theme="night"] .info-line { color:inherit; }
html[data-theme="night"] .error { color:#ffb1b1; }
html[data-theme="night"] .info-line,html[data-theme="night"] .divider,html[data-theme="night"] .paper article,html[data-theme="night"] .paper .aside { border-color:#445067; }
.scan-controls { display:flex;align-items:end;gap:10px;margin:16px 0;flex-wrap:wrap; }
.scan-controls input { max-width:130px; }
.ha-guide { margin:18px 0;padding:16px;border:1px solid #8290a755;border-radius:12px; }
.ha-guide li { margin:12px 0; }
.research-topics { padding-top:24px;border-top:1px solid #8290a755;margin-top:24px; }
.research-topics article { min-width:0;overflow-wrap:anywhere; }
.settings-grid .btn { margin:4px 3px 4px 0; }
html[data-theme="night"] .paper p { color:#c3cddd; }
html[data-theme="night"] .facts,html[data-theme="night"] .day-stamp,html[data-theme="night"] .travel-icon { background:#29364c;color:#e4eaf4; }
html[data-theme="night"] .fact span,html[data-theme="night"] .times small,html[data-theme="night"] .freshness,html[data-theme="night"] .timeline-time,html[data-theme="night"] .day-stamp small,html[data-theme="night"] .empty p { color:#adbbd0; }
html[data-theme="night"] .facts,html[data-theme="night"] .fact,html[data-theme="night"] .freshness { border-color:#445067; }
@media(max-width:700px) { html[data-theme="night"] .nav { background:#141d2bf5;border-color:#35445e; } }
