@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/Unbounded-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/Unbounded-Black.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --fp-blue: #1452d1;
  --fp-blue-header: #1452d1;
  --fp-blue-dark: #0d3d9e;
  --fp-green: #1fb861;
  --fp-red: #eb3838;
  --fp-amber: #ffd600;
  --fp-chip-yellow: #ffd600;
  --fp-chip-terminal: #38383d;
  --fp-bg: #eef1f6;
  --fp-card: #ffffff;
  --fp-text: #1a1f2e;
  --fp-muted: #5c6478;
  --fp-border: rgba(20, 82, 209, 0.12);
  --fp-radius: 18px;
  --fp-shadow: 0 8px 32px rgba(20, 40, 90, 0.08);
  --fp-header-upcoming: #9499a3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--fp-bg);
  color: var(--fp-text);
  min-height: 100%;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

/* —— App banners —— */
.app-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px -4px 0;
  padding: 10px 12px;
  background: var(--fp-card);
  border-radius: 14px;
  box-shadow: var(--fp-shadow);
  border: 1px solid var(--fp-border);
}

.app-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  flex-shrink: 0;
  object-fit: cover;
}

.app-banner-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-banner-sub {
  font-size: 0.78rem;
  color: var(--fp-muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-banner-open {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--fp-blue);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.app-banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--fp-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.app-footer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--fp-card);
  border-radius: 16px;
  box-shadow: var(--fp-shadow);
  border: 1px solid var(--fp-border);
}

.app-footer-icon {
  border-radius: 9px;
  flex-shrink: 0;
}

.app-footer-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}

.app-footer-copy strong {
  font-weight: 700;
}

.app-footer-copy .muted {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-footer-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 82, 209, 0.1);
  color: var(--fp-blue) !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 8px;
}

.site-title {
  margin: 0;
  font-family: "Unbounded", -apple-system, sans-serif;
  font-weight: 500;
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--fp-text);
  text-align: right;
  flex: 1;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-app-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(20, 40, 90, 0.12);
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  color: var(--fp-blue);
  letter-spacing: -0.01em;
}

.card {
  background: var(--fp-card);
  border-radius: var(--fp-radius);
  box-shadow: var(--fp-shadow);
  margin-top: 16px;
  overflow: hidden;
}

.flight-hero {
  margin-top: 4px;
}

.flight-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.flight-route {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.map-section {
  padding: 0;
}

.map {
  height: min(48vh, 380px);
  min-height: 260px;
  width: 100%;
  background: #dbe4f3;
}

.map-caption {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--fp-muted);
  border-top: 1px solid var(--fp-border);
}

.live-panel {
  padding: 16px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.live-stat {
  background: var(--fp-bg);
  border-radius: 12px;
  padding: 10px 12px;
}

.live-label {
  display: block;
  font-size: 0.72rem;
  color: var(--fp-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

/* —— Ticket (как в приложении) —— */
.fp-ticket-wrap {
  margin-top: 12px;
  padding: 0 2px;
}

.fp-ticket {
  position: relative;
  overflow: visible;
  margin-top: 0;
  padding-bottom: 2px;
}

.fp-ticket.card {
  box-shadow: 0 10px 36px rgba(20, 40, 90, 0.1);
}

.ticket-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: baseline;
  padding: 10px 14px;
  background: var(--fp-blue-header);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--fp-radius) var(--fp-radius) 0 0;
}

.ticket-header.upcoming {
  background: var(--fp-header-upcoming);
  color: #fff;
}

.ticket-body {
  padding: 0 14px 16px;
  background: var(--fp-card);
  border-radius: 0 0 var(--fp-radius) var(--fp-radius);
}

.ticket-leg {
  padding: 10px 0 6px;
}

.ticket-leg + .ticket-perforation {
  margin-top: 2px;
}

.leg-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.leg-date-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--fp-muted);
  font-weight: 500;
}

.leg-date-row svg {
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

.leg-status-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fp-green);
  flex-shrink: 0;
}

.leg-status-label.changed {
  color: var(--fp-red);
}

.leg-city-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.leg-city {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fp-text);
  min-width: 0;
}

.leg-city span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leg-city-chevron {
  color: var(--fp-muted);
  font-size: 0.75rem;
}

.leg-countdown {
  font-size: 0.72rem;
  color: var(--fp-muted);
  flex-shrink: 0;
}

.leg-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.leg-iata {
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.leg-time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.leg-times {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: flex-end;
}

.leg-time {
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 1.85rem;
  line-height: 1;
  color: var(--fp-green);
  font-variant-numeric: tabular-nums;
}

.leg-time.changed {
  color: var(--fp-red);
}

.leg-time-old {
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--fp-muted);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.leg-weather {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.leg-weather-temp {
  font-weight: 700;
  font-size: 0.9rem;
}

.leg-weather-label {
  color: var(--fp-muted);
  max-width: 110px;
  text-align: right;
  line-height: 1.2;
}

.leg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chip-col-label {
  font-size: 0.68rem;
  color: var(--fp-muted);
  font-weight: 500;
}

.yg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--fp-chip-yellow);
  border-radius: 9px;
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.yg-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 900;
}

.yg-chip-t {
  background: var(--fp-chip-terminal);
  color: #fff;
  border-radius: 50%;
}

.yg-chip-gate::before {
  content: "↗";
  font-size: 0.95rem;
  font-weight: 900;
}

.yg-chip-checkin::before {
  content: "▤";
  font-size: 0.85rem;
}

.yg-chip-bag::before {
  content: "🧳";
  font-size: 0.8rem;
}

.ticket-perforation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 4px 0;
}

.perf-icon {
  color: var(--fp-muted);
  font-size: 0.85rem;
}

.perf-line {
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(92, 100, 120, 0.35) 0,
    rgba(92, 100, 120, 0.35) 4px,
    transparent 4px,
    transparent 8px
  );
}

.perf-meta {
  font-size: 0.78rem;
  color: var(--fp-muted);
  font-weight: 500;
  white-space: nowrap;
}

.ticket-notch {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fp-bg);
  top: var(--perf-y, 52%);
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
}

.ticket-notch-left {
  left: -15px;
}

.ticket-notch-right {
  right: -15px;
}

/* —— Airline card —— */
.airline-card {
  padding: 14px 16px;
}

.airline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.airline-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.airline-name {
  font-weight: 600;
  color: var(--fp-blue);
  text-decoration: none;
  font-size: 1rem;
}

.airline-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.airline-detail .detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--fp-muted);
  margin-bottom: 4px;
}

.airline-detail strong {
  font-size: 0.95rem;
}

/* —— CTA —— */
.app-cta {
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(145deg, #4f46e5 0%, #1452d1 55%, #0d3d9e 100%);
  color: #fff;
}

.app-cta-lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0.95;
}

.app-cta-button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  background: #fff;
  color: var(--fp-blue) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.78rem;
}

.site-brand-line {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.site-footer-link {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(92, 100, 120, 0.12);
  color: var(--fp-text) !important;
  text-decoration: none;
  font-weight: 600;
}

.muted {
  color: var(--fp-muted);
}

.state-panel {
  text-align: center;
  padding: 64px 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid rgba(20, 82, 209, 0.15);
  border-top-color: var(--fp-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-icon {
  font-size: 2.5rem;
  opacity: 0.35;
}

.plane-marker {
  background: none !important;
  border: none !important;
}

.plane-marker-inner {
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: transform 0.4s ease;
}

.airport-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.airport-marker.dep {
  background: var(--fp-green);
}

.airport-marker.arr {
  background: var(--fp-red);
}

@media (min-width: 640px) {
  .live-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 380px) {
  .leg-iata {
    font-size: 1.75rem;
  }

  .leg-time {
    font-size: 1.55rem;
  }

  .app-banner-sub {
    -webkit-line-clamp: 1;
  }
}
