
.aph-flight-search{
  --aph:#8f124b;--aph-dark:#60092f;--navy:#0a213f;--navy-2:#102c51;
  --ink:#111d2e;--muted:#66768d;--line:#dfe6ef;--soft:#f4f7fb;
  --sheet-shadow:0 -26px 80px rgba(6,20,40,.26);
  position:relative;padding:18px 22px 20px;border-radius:26px;color:#fff;
  background:linear-gradient(145deg,#0b2443,#081b34);
  box-shadow:0 28px 70px rgba(6,24,49,.25);
  font-family:Inter,Arial,sans-serif
}
.aph-flight-search *{box-sizing:border-box}
.aph-fs-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;margin-bottom:14px}
.aph-fs-kicker{font-size:11px;letter-spacing:.15em;color:#f0a9c6;font-weight:900}
.aph-fs-header h3{margin:4px 0 0;font-size:24px;color:#fff}
.aph-fs-trip-tabs{display:flex;gap:6px;flex-wrap:wrap}
.aph-fs-trip,.aph-fs-airline-chips button,.aph-fs-popular-list button{
  border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:9px 14px;
  background:rgba(255,255,255,.09);color:#fff;font-weight:750;cursor:pointer;transition:.18s
}
.aph-fs-trip:hover,.aph-fs-airline-chips button:hover,.aph-fs-popular-list button:hover{background:rgba(255,255,255,.16)}
.aph-fs-trip.active{background:#fff;color:var(--navy);box-shadow:0 6px 18px rgba(0,0,0,.12)}

.aph-fs-main-grid{
  display:grid;
  grid-template-columns:minmax(155px,1.05fr) 34px minmax(155px,1.05fr) minmax(130px,.82fr) minmax(130px,.82fr) minmax(155px,.92fr) 172px;
  gap:7px;align-items:stretch
}
.aph-fs-airport-field,.aph-fs-date-trigger,.aph-fs-traveller-trigger{
  position:relative;min-width:0;background:#fff;border:1px solid rgba(14,42,78,.08);
  border-radius:12px;padding:9px 12px;color:var(--ink);text-align:left;min-height:62px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.45);transition:.18s
}
.aph-fs-airport-field:focus-within,.aph-fs-date-trigger:hover,.aph-fs-traveller-trigger:hover{
  border-color:#8f124b;box-shadow:0 0 0 3px rgba(143,18,75,.08)
}
.aph-fs-label{display:block;font-size:11px;color:var(--muted);margin-bottom:5px;font-weight:650}
.aph-fs-airport-input{width:100%;border:0;outline:0;font-weight:800;color:var(--ink);font-size:14px;background:transparent}
.aph-fs-airport-input::placeholder{color:#8592a4;font-weight:650}
.aph-fs-date-value,.aph-fs-traveller-summary{font-size:13px;color:var(--ink)}
.aph-fs-swap{
  align-self:center;width:34px;height:34px;border-radius:50%;border:1px solid rgba(255,255,255,.35);
  background:#fff;color:var(--aph);font-weight:900;cursor:pointer;transition:.3s;box-shadow:0 6px 16px rgba(0,0,0,.12)
}
.aph-fs-swap:hover{transform:rotate(180deg)}
.aph-fs-submit{
  border:0;border-radius:12px;background:linear-gradient(135deg,#a21657,#7c0d3e);
  color:#fff;font-weight:850;cursor:pointer;min-height:62px;
  box-shadow:0 12px 26px rgba(143,18,75,.26);transition:.18s
}
.aph-fs-submit:hover{transform:translateY(-1px);box-shadow:0 16px 30px rgba(143,18,75,.34)}
.aph-fs-search-icon{font-size:20px;margin-right:5px}

/* Always-open-below airport results */
.aph-fs-airport-results{
  display:none;position:absolute;left:0;top:calc(100% + 8px);z-index:50;
  width:min(420px,92vw);max-height:320px;overflow:auto;background:#fff;color:var(--ink);
  border-radius:15px;box-shadow:0 22px 60px rgba(4,20,42,.28);border:1px solid var(--line)
}
.aph-fs-airport-field[data-kind="destination"] .aph-fs-airport-results{left:auto;right:0}
.aph-fs-airport-results.open{display:block}
.aph-fs-airport-option{display:flex;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);cursor:pointer}
.aph-fs-airport-option:hover{background:var(--soft)}
.aph-fs-airport-option strong{display:block;color:var(--ink)}
.aph-fs-airport-option small{display:block;color:var(--muted);margin-top:2px}

.aph-fs-options{display:flex;flex-wrap:wrap;gap:18px;margin-top:13px;color:#e7edf5;font-size:13px}
.aph-fs-options label{display:flex;align-items:center;gap:7px;color:#e7edf5}
.aph-fs-options input{accent-color:#d23d7d}
.aph-fs-airlines{margin-top:14px}
.aph-fs-airlines>.aph-fs-label{color:#8da1bb}
.aph-fs-airline-chips{display:flex;gap:8px;flex-wrap:wrap}
.aph-fs-airline-chips button.active{background:#fff;color:var(--aph)}
.aph-fs-validation{min-height:18px;margin-top:8px;color:#ffd9e8;font-size:13px}
.aph-fs-recent,.aph-fs-popular{margin-top:16px;padding-top:14px;border-top:1px solid rgba(255,255,255,.12)}
.aph-fs-section-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.aph-fs-section-head strong{color:#fff}
.aph-fs-clear-recent{border:0;background:transparent;color:#d7e0ea;cursor:pointer}
.aph-fs-recent-list,.aph-fs-popular-list{display:flex;gap:8px;flex-wrap:wrap}
.aph-fs-recent-item{border:1px solid rgba(255,255,255,.14);border-radius:12px;background:rgba(255,255,255,.07);color:#fff;padding:9px 12px;cursor:pointer}

.aph-fs-multicity{display:none;margin-top:10px}.aph-fs-multicity.active{display:grid;gap:8px}
.aph-fs-segment{display:grid;grid-template-columns:1fr 1fr .8fr 42px;gap:8px}
.aph-fs-segment input{width:100%;border:0;outline:0;background:#fff;color:var(--ink);padding:11px 12px;border-radius:10px;font-weight:700}
.aph-fs-segment button{border:0;border-radius:10px;background:rgba(255,255,255,.12);color:#fff}
.aph-fs-add-segment{justify-self:start;border:1px solid rgba(255,255,255,.2);background:transparent;color:#fff;border-radius:10px;padding:10px 13px;cursor:pointer}

/* Fixed bottom sheets */
.aph-fs-calendar-modal,.aph-fs-traveller-modal,.aph-fs-loading{position:fixed;inset:0;z-index:99999}
.aph-fs-modal-backdrop{position:absolute;inset:0;background:rgba(3,14,29,.58);backdrop-filter:blur(5px)}
.aph-fs-bottom-sheet{
  position:absolute;left:50%;bottom:0;transform:translateX(-50%);
  width:min(1100px,100%);max-height:88vh;overflow:auto;background:#fff;color:var(--ink);
  border-radius:24px 24px 0 0;padding:20px 28px 24px;box-shadow:var(--sheet-shadow)
}
.aph-fs-calendar-modal{
  position:absolute;inset:auto;z-index:999;
  pointer-events:none
}
.aph-fs-calendar-modal[hidden]{display:none}
.aph-fs-calendar-modal .aph-fs-modal-backdrop{display:none}
.aph-fs-calendar-modal .aph-fs-calendar-sheet{
  position:absolute;left:0;top:0;bottom:auto;transform:none;
  width:min(760px,calc(100vw - 32px));max-height:none;overflow:visible;
  border-radius:18px;padding:16px 18px 18px;box-shadow:0 22px 60px rgba(4,20,42,.24);
  border:1px solid var(--line);pointer-events:auto
}
.aph-fs-calendar-modal .aph-fs-sheet-handle{display:none}
.aph-fs-calendar-modal .aph-fs-sheet-header h4{font-size:20px}
.aph-fs-calendar-modal .aph-fs-sheet-header .aph-fs-kicker{color:var(--aph)}
.aph-fs-calendar-modal .aph-fs-calendar-toolbar{margin:12px 0}
.aph-fs-calendar-modal .aph-fs-calendar-grid{gap:24px}
.aph-fs-calendar-modal .aph-fs-day{min-height:38px}
.aph-fs-calendar-modal .aph-fs-calendar-footer{
  position:static;margin:16px -18px -18px;padding:14px 18px;border-radius:0 0 18px 18px
}
.aph-fs-sheet-handle{width:54px;height:5px;border-radius:999px;background:#d7dee7;margin:0 auto 16px}
.aph-fs-sheet-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}
.aph-fs-sheet-header h4,.aph-fs-passenger-card h4{margin:5px 0 0;color:var(--ink);font-size:24px}
.aph-fs-modal-close{position:static;border:0;background:#f0f3f7;color:var(--ink);width:38px;height:38px;border-radius:50%;font-size:24px;cursor:pointer}

.aph-fs-calendar-toolbar{display:flex;justify-content:space-between;gap:18px;align-items:center;margin:18px 0}
.aph-fs-calendar-trip-label{border:1px solid var(--line);padding:9px 13px;border-radius:10px;font-weight:750}
.aph-fs-date-mode{display:flex;background:#edf2f7;border-radius:10px;overflow:hidden}
.aph-fs-date-mode button{border:0;padding:10px 16px;background:transparent;color:var(--ink);font-weight:750}
.aph-fs-date-mode button.active{background:var(--navy);color:#fff}

.aph-fs-calendar-nav{display:grid;grid-template-columns:46px 1fr 1fr 46px;align-items:center;margin-bottom:10px}
.aph-fs-calendar-nav button{border:0;background:transparent;font-size:34px;color:var(--ink);cursor:pointer}
.aph-fs-month-title{text-align:center;font-size:20px;font-weight:850;color:var(--ink)}
.aph-fs-calendar-grid{display:grid;grid-template-columns:1fr 1fr;gap:44px}
.aph-fs-month{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.aph-fs-weekday{text-align:center;font-size:12px;color:var(--muted);padding:8px 0}
.aph-fs-day{
  position:relative;border:0;background:transparent;min-height:43px;border-radius:10px;
  color:var(--ink);font-weight:750;cursor:pointer
}
.aph-fs-day:hover:not(:disabled){background:#eef4fb}
.aph-fs-day:disabled{color:#cfd7e1;cursor:not-allowed}
.aph-fs-day.selected-start,.aph-fs-day.selected-end{background:#1268e8;color:#fff;border-radius:50%}
.aph-fs-day.in-range{background:#dcecff;border-radius:0}
.aph-fs-day.selected-start.in-range{border-radius:50% 0 0 50%}
.aph-fs-day.selected-end.in-range{border-radius:0 50% 50% 0}
.aph-fs-day.today:after{content:"";position:absolute;left:50%;bottom:5px;width:4px;height:4px;border-radius:50%;background:var(--aph)}
.aph-fs-calendar-footer{
  position:sticky;bottom:-24px;margin:22px -28px -24px;padding:16px 28px;
  display:flex;justify-content:flex-end;align-items:center;gap:22px;background:#fff;border-top:1px solid var(--line)
}
.aph-fs-selected-summary{margin-right:auto;color:var(--muted)}
.aph-fs-date-apply,.aph-fs-passenger-apply{
  border:0;border-radius:10px;background:#1268e8;color:#fff;padding:12px 22px;font-weight:850;cursor:pointer
}
.aph-fs-date-apply:disabled{opacity:.45;cursor:not-allowed}

.aph-fs-passenger-card{width:min(560px,100%)}
.aph-fs-counter-row{display:flex;justify-content:space-between;align-items:center;padding:16px 0;border-bottom:1px solid var(--line)}
.aph-fs-counter-row strong{color:var(--ink)}.aph-fs-counter-row small{display:block;color:var(--muted)}
.aph-fs-counter{display:flex;gap:12px;align-items:center;color:var(--ink)}
.aph-fs-counter button{width:32px;height:32px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--aph)}
.aph-fs-cabin-label{display:block;margin-top:18px;color:var(--ink);font-weight:750}
.aph-fs-cabin{width:100%;border:1px solid var(--line);border-radius:10px;padding:12px;margin-top:7px;color:var(--ink);background:#fff}

.aph-fs-loading{background:rgba(4,14,29,.65);backdrop-filter:blur(5px)}
.aph-fs-loading-card{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:min(390px,calc(100% - 28px));background:#fff;color:var(--ink);
  border-radius:20px;padding:28px;text-align:center;box-shadow:0 25px 70px rgba(0,0,0,.3)
}
.aph-fs-plane{font-size:48px;animation:aphFly 1.1s ease-in-out infinite alternate}
.aph-fs-loading-card strong,.aph-fs-loading-card span{display:block}
.aph-fs-loading-card span{color:var(--muted);margin-top:6px}
@keyframes aphFly{from{transform:translateX(-16px) rotate(-8deg)}to{transform:translateX(16px) rotate(5deg)}}

@media(max-width:1100px){
  .aph-fs-main-grid{grid-template-columns:1fr 34px 1fr 1fr}
  .aph-fs-submit{min-height:68px}
}
@media(max-width:760px){
  .aph-flight-search{padding:15px;border-radius:20px}
  .aph-fs-calendar-modal,.aph-fs-traveller-modal{position:fixed;inset:0;z-index:99999}
  .aph-fs-calendar-modal .aph-fs-modal-backdrop,.aph-fs-traveller-modal .aph-fs-modal-backdrop{
    display:block;position:absolute;inset:0;background:rgba(3,14,29,.58);backdrop-filter:blur(5px)
  }
  .aph-fs-calendar-modal .aph-fs-calendar-sheet{
    position:absolute;left:50%;bottom:0;top:auto;transform:translateX(-50%);
    width:100%;max-height:88vh;overflow:auto;border-radius:24px 24px 0 0;
    padding:16px 16px 20px;box-shadow:var(--sheet-shadow);border:0
  }
  .aph-fs-calendar-modal .aph-fs-sheet-handle{display:block}
  .aph-fs-calendar-modal .aph-fs-calendar-footer{
    position:sticky;bottom:-20px;margin:18px -16px -20px;padding:14px 16px;border-radius:0
  }
  .aph-fs-header{align-items:flex-start;flex-direction:column}
  .aph-fs-main-grid{grid-template-columns:1fr}
  .aph-fs-swap{justify-self:center}
  .aph-fs-segment{grid-template-columns:1fr}
  .aph-fs-calendar-grid{grid-template-columns:1fr;gap:28px}
  .aph-fs-month[data-month-index="1"]{display:none}
  .aph-fs-calendar-nav{grid-template-columns:42px 1fr 42px}
  .aph-fs-month-title-right{display:none}
  .aph-fs-calendar-next{grid-column:3}
  .aph-fs-bottom-sheet{padding:16px 16px 20px}
  .aph-fs-calendar-footer{margin:18px -16px -20px;padding:14px 16px}
  .aph-fs-selected-summary{font-size:12px}
}

@media(min-width:761px){
  .aph-flight-search{overflow:visible}
  .aph-fs-calendar-modal{
    position:absolute;
    left:0;
    top:0;
    width:0;
    height:0;
  }
  .aph-fs-calendar-modal .aph-fs-calendar-sheet{
    animation:aphCalendarIn .18s ease-out;
  }
}
@keyframes aphCalendarIn{
  from{opacity:0;transform:translateY(-6px)}
  to{opacity:1;transform:translateY(0)}
}

/* V4 refinement */
.aph-flight-search{font-weight:400}
.aph-fs-header h3,.aph-fs-trip,.aph-fs-submit,.aph-fs-date-value,.aph-fs-traveller-summary,
.aph-fs-airport-input,.aph-fs-airline-chips button,.aph-fs-popular-list button{font-weight:600}
.aph-fs-field-error{
  display:none;margin-top:4px;color:#b42350;font-size:11px;font-weight:600
}
.aph-fs-airport-field.has-error,.aph-fs-date-trigger.has-error{
  border-color:#d54a78;box-shadow:0 0 0 3px rgba(213,74,120,.1)
}
.aph-fs-airport-field.has-error .aph-fs-field-error,
.aph-fs-date-trigger.has-error .aph-fs-field-error{display:block}
.aph-fs-airport-option{transition:background .15s ease,transform .15s ease}
.aph-fs-airport-option:hover{transform:translateX(2px)}
.aph-fs-swap.swapping{animation:aphSwap .38s ease}
@keyframes aphSwap{0%{transform:rotate(0)}50%{transform:rotate(180deg) scale(1.08)}100%{transform:rotate(360deg)}}
.aph-fs-submit:active{transform:translateY(1px)}
.aph-fs-loading-bar{height:6px;background:#edf1f6;border-radius:999px;overflow:hidden;margin-top:16px}
.aph-fs-loading-bar span{display:block;height:100%;width:35%;background:linear-gradient(90deg,#8f124b,#d35d8d);border-radius:999px;animation:aphLoad 1.2s ease-in-out infinite}
@keyframes aphLoad{0%{transform:translateX(-120%)}100%{transform:translateX(320%)}}
