/* ================================================================
   AviaPages Charter Suite v2 — Frontend CSS
   Aesthetic: Editorial Aviation — Warm slate + amber gold, 
   sharp geometry, refined typography, deliberate whitespace
   Fonts: DM Serif Display (headings) + DM Sans (body)
   ================================================================ */


/* ── Design tokens ───────────────────────────────────────── */
:root {
    --apc-ink:        #1c1917;      /* warm near-black */
    --apc-slate:      #144D41;
    --apc-slate-mid:  #1a6254;
    --apc-slate-soft: #78716c;
    --apc-stone:      #a8a29e;
    --apc-rule:       #e7e5e4;
    --apc-bg:         #fafaf9;
    --apc-white:      #ffffff;

    --apc-gold:       #b45309;      /* amber-700 — rich, not gaudy */
    --apc-gold-lt:    #d97706;
    --apc-gold-pale:  #fef3c7;
    --apc-gold-rule:  #fcd34d;

    --apc-sky:        #0c4a6e;      /* deep sky blue accent */
    --apc-sky-lt:     #0369a1;
    --apc-sky-pale:   #e0f2fe;

    --apc-success:    #166534;
    --apc-error:      #991b1b;
    --apc-error-bg:   #fef2f2;

    --apc-r:          10px;         /* border-radius */
    --apc-r-sm:       6px;
    --apc-shadow:     0 1px 3px rgba(28,25,23,.08), 0 8px 24px rgba(28,25,23,.06);
    --apc-shadow-md:  0 4px 6px rgba(28,25,23,.06), 0 12px 40px rgba(28,25,23,.10);
    --apc-trans:      220ms cubic-bezier(.4,0,.2,1);

    --apc-f-serif:    inherit;
    --apc-f-sans:     inherit;
}

/* ── Widget shell ────────────────────────────────────────── */
.apc-widget {
    font-family: var(--apc-f-sans);
    font-size: 15px;
    color: var(--apc-ink);
    background: var(--apc-white);
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r);
    box-shadow: var(--apc-shadow);
    overflow: hidden;
    margin: 2.5rem 0;
    position: relative;
}

/* ── Header ──────────────────────────────────────────────── */
.apc-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: var(--apc-slate);
    border-bottom: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.apc-widget__header::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--apc-gold-rule) 0%, var(--apc-gold) 50%, transparent 100%);
}

.apc-widget__header-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.apc-widget__svg-icon {
    width: 22px; height: 22px;
    color: var(--apc-gold-lt);
    flex-shrink: 0;
}

.apc-widget__title {
    font-family: var(--apc-f-serif);
    font-size: 1.375rem;
    font-weight: 400;
    color: var(--apc-white);
    margin: 0;
    letter-spacing: .01em;
    line-height: 1.2;
}

/* ── Mode tabs ───────────────────────────────────────────── */
.apc-mode-tabs {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,.08);
    border-radius: var(--apc-r-sm);
    padding: 2px;
}

.apc-tab {
    font-family: var(--apc-f-sans);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    background: none;
    border: none;
    border-radius: 4px;
    padding: .35rem .75rem;
    cursor: pointer;
    transition: background var(--apc-trans), color var(--apc-trans);
}

.apc-tab--active {
    background: rgba(255,255,255,.15);
    color: var(--apc-white);
}

/* ── Body / form area ────────────────────────────────────── */
.apc-widget__body {
    padding: 1.5rem 1.75rem;
    background: var(--apc-bg);
}

.apc-filters {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--apc-rule);
    background: var(--apc-white);
}

/* ── Form layout ─────────────────────────────────────────── */
.apc-form__row {
    display: flex;
    gap: .875rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: .875rem;
}

.apc-form__row:last-child { margin-bottom: 0; }

.apc-form__row--submit {
    padding-top: .5rem;
    justify-content: flex-start;
}

.apc-form__field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 160px;
    flex: 1;
}

.apc-form__field--grow  { flex: 2; }
.apc-form__field--sm    { flex: 0 0 110px; min-width: 90px; }
.apc-form__field--btn   { justify-content: flex-end; flex: 0 0 auto; }

/* ── Labels ──────────────────────────────────────────────── */
.apc-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--apc-slate-soft);
    user-select: none;
    /* Fixed height + baseline alignment so an injected timezone
       label (e.g. "(UTC+08:00)") never pushes the input down. */
    display: flex;
    align-items: baseline;
    min-height: 1.1rem;
    line-height: 1.1rem;
    white-space: nowrap;
}

.apc-req      { color: var(--apc-gold); }
.apc-optional { color: var(--apc-stone); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── Inputs ──────────────────────────────────────────────── */
.apc-input {
    font-family: var(--apc-f-sans);
    font-size: .9rem;
    color: var(--apc-ink);
    background: var(--apc-white);
    border: 1.5px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    padding: .6rem .875rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--apc-trans), box-shadow var(--apc-trans);
    outline: none;
    appearance: none;
    line-height: 1.4;
}

.apc-input:focus {
    border-color: var(--apc-gold);
    box-shadow: 0 0 0 3px rgba(180,83,9,.12);
}

.apc-input::placeholder { color: var(--apc-stone); }

.apc-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ── Autocomplete ────────────────────────────────────────── */
.apc-ac-wrap { position: relative; }

.apc-ac-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--apc-white);
    border: 1.5px solid var(--apc-gold);
    border-radius: var(--apc-r-sm);
    box-shadow: var(--apc-shadow-md);
    list-style: none;
    margin: 0; padding: .3rem 0;
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}

.apc-ac-list li {
    padding: .5rem .875rem;
    font-size: .85rem;
    cursor: pointer;
    color: var(--apc-ink);
    border-bottom: 1px solid var(--apc-rule);
    line-height: 1.35;
    transition: background var(--apc-trans);
}

.apc-ac-list li:last-child  { border-bottom: none; }
.apc-ac-list li:hover,
.apc-ac-list li[aria-selected="true"] {
    background: var(--apc-gold-pale);
    color: var(--apc-slate);
}

.apc-ac-tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .35rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--apc-sky-lt);
    background: var(--apc-sky-pale);
    border-radius: 4px;
    padding: .2rem .55rem;
}

/* ── Swap button ─────────────────────────────────────────── */
.apc-swap {
    margin-top: 1.6rem;
    flex-shrink: 0;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--apc-white);
    border: 1.5px solid var(--apc-rule);
    border-radius: 50%;
    cursor: pointer;
    color: var(--apc-slate-mid);
    transition: all var(--apc-trans);
}

.apc-swap:hover {
    border-color: var(--apc-gold);
    color: var(--apc-gold);
    background: var(--apc-gold-pale);
    transform: rotate(180deg);
}

/* ── Buttons ─────────────────────────────────────────────── */
.apc-btn {
    font-family: var(--apc-f-sans);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    border: none;
    border-radius: var(--apc-r-sm);
    padding: .65rem 1.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    transition: all var(--apc-trans);
    white-space: nowrap;
    position: relative;
}

.apc-btn:disabled { opacity: .6; cursor: not-allowed; }

.apc-btn--primary {
    background: var(--apc-slate);
    color: var(--apc-white);
    box-shadow: 0 2px 8px rgba(28,25,23,.2);
}

.apc-btn--primary:hover:not(:disabled) {
    background: var(--apc-ink);
    box-shadow: 0 4px 16px rgba(28,25,23,.3);
    transform: translateY(-1px);
}

.apc-btn--gold {
    background: var(--apc-gold);
    color: var(--apc-white);
    box-shadow: 0 2px 8px rgba(180,83,9,.25);
}

.apc-btn--gold:hover:not(:disabled) {
    background: var(--apc-gold-lt);
    box-shadow: 0 4px 16px rgba(180,83,9,.35);
    transform: translateY(-1px);
    color: var(--apc-white);
}

.apc-btn--xl { font-size: .9rem; padding: .875rem 2rem; }

.apc-btn__loading { display: none; align-items: center; gap: .5rem; }
.apc-btn--busy .apc-btn__text { display: none; }
.apc-btn--busy .apc-btn__loading { display: flex; }

/* ── Spinner ─────────────────────────────────────────────── */
.apc-spinner {
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: apc-spin .7s linear infinite;
    display: inline-block;
}

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

/* ── Fieldset ────────────────────────────────────────────── */
.apc-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.apc-fieldset__legend {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
    margin-bottom: 1rem;
    display: block;
    padding: 0;
    width: 100%;
    border-bottom: 1px solid var(--apc-rule);
    padding-bottom: .5rem;
}

/* ── Alerts ──────────────────────────────────────────────── */
.apc-alert {
    border-radius: var(--apc-r-sm);
    padding: .75rem 1rem;
    font-size: .85rem;
    margin: .75rem 0;
    line-height: 1.5;
}

.apc-alert--error {
    background: var(--apc-error-bg);
    border: 1px solid rgba(153,27,27,.2);
    color: var(--apc-error);
}

/* ── Loading ─────────────────────────────────────────────── */
.apc-loading {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: center;
    padding: 2.5rem;
    color: var(--apc-stone);
    font-size: .875rem;
}

/* ── Results panel ───────────────────────────────────────── */
.apc-results {
    border-top: 1px solid var(--apc-rule);
    margin-top: 1.25rem;
    animation: apc-slide-in .35s ease both;
}

@keyframes apc-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.apc-results__section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--apc-rule);
}

.apc-results__section:last-child { border-bottom: none; }

.apc-results__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .875rem;
}

.apc-results__section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
}

.apc-route-badge {
    font-size: .8rem;
    font-weight: 500;
    color: var(--apc-slate-mid);
    font-style: italic;
}

/* ── Stats grid ──────────────────────────────────────────── */
.apc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .75rem;
}

.apc-stat {
    background: var(--apc-white);
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    padding: .875rem;
    text-align: center;
    transition: box-shadow var(--apc-trans);
}

.apc-stat:hover { box-shadow: var(--apc-shadow); }

.apc-stat__icon  { font-size: 1.25rem; margin-bottom: .25rem; }

.apc-stat__label {
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--apc-stone);
    margin-bottom: .25rem;
}

.apc-stat__value {
    font-family: var(--apc-f-serif);
    font-size: 1.15rem;
    color: var(--apc-ink);
    font-weight: 400;
}

/* Tech stops */
.apc-tech-stops {
    margin-top: .875rem;
    font-size: .8rem;
    color: var(--apc-slate-soft);
}

.apc-label-small {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--apc-stone);
    margin-right: .35rem;
}

/* ── Price hero ──────────────────────────────────────────── */
.apc-results__section--price {
    background: var(--apc-slate);
    border-radius: var(--apc-r-sm);
    padding: 1.5rem;
    margin-top: .875rem;
    border-bottom: none;
}

.apc-price-hero {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 1.25rem;
}

.apc-price-hero__label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.45);
    margin-bottom: .5rem;
}

.apc-price-hero__value {
    font-family: var(--apc-f-serif);
    font-size: 2.75rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
    line-height: 1;
    letter-spacing: -.01em;
}

.apc-price-hero__note {
    font-size: .75rem;
    color: rgba(255,255,255,.3);
    margin-top: .4rem;
}

/* Price breakdown table */
.apc-price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.apc-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    font-size: .85rem;
    color: rgba(255,255,255,.55);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.apc-breakdown-row:last-child { border-bottom: none; }

.apc-breakdown-row--total {
    color: var(--apc-white);
    font-weight: 600;
    font-size: .9rem;
    padding-top: .875rem;
    border-top: 1px solid rgba(255,255,255,.15);
    border-bottom: none;
    margin-top: .25rem;
}

.apc-price-cta {
    text-align: center;
    margin-top: 1.25rem;
}

/* ── Aircraft jet grid ───────────────────────────────────── */
.apc-jet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: var(--apc-bg);
}

.apc-jet-card {
    background: var(--apc-white);
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r);
    overflow: hidden;
    transition: box-shadow var(--apc-trans), transform var(--apc-trans);
    display: flex;
    flex-direction: column;
}

.apc-jet-card:hover {
    box-shadow: var(--apc-shadow-md);
    transform: translateY(-2px);
}

.apc-jet-card__head {
    background: var(--apc-slate);
    padding: .875rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.apc-jet-card__name {
    font-family: var(--apc-f-serif);
    font-size: 1.05rem;
    color: var(--apc-white);
    font-weight: 400;
    line-height: 1.2;
}

.apc-jet-card__class {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--apc-gold-rule);
    border: 1px solid rgba(252,211,77,.25);
    border-radius: 3px;
    padding: .15rem .45rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.apc-jet-card__body {
    padding: .875rem 1rem;
    flex: 1;
}

.apc-jet-specs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.apc-jet-spec { display: flex; flex-direction: column; gap: .1rem; }

.apc-jet-spec__label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--apc-stone);
}

.apc-jet-spec__value {
    font-size: .875rem;
    font-weight: 600;
    color: var(--apc-ink);
}

.apc-jet-card__foot {
    padding: .625rem 1rem;
    border-top: 1px solid var(--apc-rule);
    display: flex;
    justify-content: flex-end;
}

/* ── Empty legs ──────────────────────────────────────────── */
.apc-el-list {
    padding: 0 1.75rem 1.5rem;
    background: var(--apc-bg);
}

.apc-el-item {
    background: var(--apc-white);
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    padding: 1rem 1.25rem;
    margin-top: .625rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr 1fr auto;
    gap: .75rem;
    align-items: center;
    transition: box-shadow var(--apc-trans), border-color var(--apc-trans);
}

.apc-el-item:hover {
    box-shadow: var(--apc-shadow);
    border-color: var(--apc-gold-rule);
}

.apc-el-airport {
    font-weight: 600;
    font-size: .9rem;
    color: var(--apc-ink);
}

.apc-el-city {
    font-size: .75rem;
    color: var(--apc-stone);
    margin-top: .1rem;
}

.apc-el-arrow {
    color: var(--apc-gold);
    font-size: 1.25rem;
    font-weight: 300;
    flex-shrink: 0;
}

.apc-el-meta { font-size: .8rem; color: var(--apc-slate-soft); }
.apc-el-meta strong { color: var(--apc-ink); }

.apc-el-date {
    font-size: .8rem;
    font-weight: 600;
    color: var(--apc-ink);
    text-align: right;
}

/* ── Live badge ──────────────────────────────────────────── */
.apc-live-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #86efac;
    background: rgba(134,239,172,.1);
    border: 1px solid rgba(134,239,172,.2);
    border-radius: 20px;
    padding: .2rem .65rem;
}

.apc-live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: apc-pulse 1.8s ease-in-out infinite;
}

@keyframes apc-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .35; }
}

/* ── Success state ───────────────────────────────────────── */
.apc-success {
    text-align: center;
    padding: 3rem 2rem;
    animation: apc-slide-in .4s ease both;
}

.apc-success__icon {
    font-size: 3rem;
    display: block;
    margin-bottom: .75rem;
}

.apc-success__title {
    font-family: var(--apc-f-serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--apc-ink);
    margin: 0 0 .5rem;
}

.apc-success__text {
    color: var(--apc-slate-soft);
    font-size: .9rem;
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .apc-widget__header { padding: 1rem 1.25rem; }
    .apc-widget__body, .apc-filters { padding: 1.25rem; }
    .apc-widget__title { font-size: 1.15rem; }
    .apc-price-hero__value { font-size: 2.15rem; }
    .apc-jet-grid { padding: 1.25rem; grid-template-columns: 1fr; }
    .apc-el-list  { padding: 0 1.25rem 1.25rem; }
    .apc-el-item  { grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto; }
    .apc-el-date, .apc-el-actions { grid-column: 1/-1; text-align: left; }
    .apc-mode-tabs { display: none; }
    .apc-swap { display: none; }
    .apc-form__field--sm { flex: 0 0 100%; }
}

/* Utility */
.apc-hidden { display: none !important; }

/* ─── Advanced Settings Panel ─────────────────────── */
.apc-btn--secondary {
    background: transparent;
    color: var(--apc-slate-mid);
    border: 1.5px solid var(--apc-rule);
}
.apc-btn--secondary:hover {
    border-color: var(--apc-gold);
    color: var(--apc-gold);
    background: var(--apc-gold-pale);
}

.apc-advanced-panel {
    background: var(--apc-off-white);
    border: 1.5px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    padding: 1.25rem;
    margin-top: .75rem;
}

.apc-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.apc-field-hint {
    font-size: .68rem;
    color: var(--apc-stone);
    margin: .25rem 0 0;
    line-height: 1.4;
}

/* ─── Timezone label next to time input ───────────── */
.apc-tz-label {
    font-size: .65rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--apc-gold);
    margin-left: .35rem;
}

/* ─── Results link to AviaPages ───────────────────── */
.apc-results-link a {
    font-size: .8rem;
}

/* ─── Quick Stats Bar ─────────────────────────────── */
.apc-results-wrap {
    border-top: 2px solid var(--apc-gold-rule);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    animation: apc-slide-in .3s ease both;
}

.apc-quickstats {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--apc-slate);
    border-radius: var(--apc-r-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.apc-quickstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    flex: 1;
    min-width: 100px;
    border-right: 1px solid rgba(255,255,255,.08);
    text-align: center;
    gap: .2rem;
}

.apc-quickstat:last-child { border-right: none; }
.apc-quickstat--link { padding: .75rem 1.25rem; }

.apc-quickstat__icon { font-size: 1.1rem; }

.apc-quickstat__label {
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.45);
}

.apc-quickstat__val {
    font-family: var(--apc-f-serif);
    font-size: 1.2rem;
    color: var(--apc-gold-rule);
    font-weight: 400;
}

/* ─── Iframe Embed ────────────────────────────────── */
.apc-iframe-wrap {
    border: 1.5px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

.apc-iframe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--apc-stone);
    font-size: .875rem;
}

.apc-results-iframe {
    width: 100%;
    height: 900px;
    border: none;
    display: block;
    background: #fff;
}

.apc-iframe-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--apc-off-white);
    border-top: 1px solid var(--apc-rule);
    gap: .75rem;
    flex-wrap: wrap;
}

.apc-calc-cta {
    text-align: center;
    padding: 1rem 0;
}

@media (max-width: 640px) {
    .apc-quickstats { flex-direction: column; }
    .apc-quickstat  { flex-direction: row; justify-content: space-between; width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
    .apc-results-iframe { height: 600px; }
}

/* ══════════════════════════════════════════════════
   Results Panel — CTO-confirmed field mapping
   ══════════════════════════════════════════════════ */

.apc-results {
    border-top: 3px solid var(--apc-gold-rule);
    animation: apc-slide-in .3s ease both;
}

.apc-results__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 1.75rem;
    background: var(--apc-slate);
}

.apc-results__route-badge {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.apc-results__from,
.apc-results__to {
    font-family: var(--apc-f-serif);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
    letter-spacing: .02em;
}

/* Stats grid */
.apc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
    background: var(--apc-slate);
    border-top: 1px solid rgba(255,255,255,.07);
}

.apc-stat {
    padding: 1.25rem 1.5rem;
    border-right: 1px solid rgba(255,255,255,.07);
    text-align: center;
}
.apc-stat:last-child { border-right: none; }

.apc-stat__icon  { font-size: 1.25rem; margin-bottom: .3rem; }

.apc-stat__label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.4);
    margin-bottom: .3rem;
}

.apc-stat__value {
    font-family: var(--apc-f-serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
    line-height: 1.1;
}

.apc-stat__sub {
    font-size: .7rem;
    color: rgba(255,255,255,.35);
    margin-top: .2rem;
    min-height: 1rem;
}

/* Section label */
.apc-section-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
    padding: 1rem 1.75rem .5rem;
    border-top: 1px solid var(--apc-rule);
    background: var(--apc-white);
}

/* Fuel breakdown table */
.apc-fuel-breakdown { background: var(--apc-white); }

.apc-fuel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    font-family: var(--apc-f-sans);
    margin-bottom: 0;
}

.apc-fuel-table th {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--apc-stone);
    padding: .5rem 1.75rem;
    text-align: left;
    border-bottom: 1px solid var(--apc-rule);
    background: var(--apc-off-white);
}

.apc-fuel-table td {
    padding: .45rem 1.75rem;
    color: var(--apc-text);
    border-bottom: 1px solid var(--apc-rule);
}

.apc-fuel-table tbody tr:hover { background: var(--apc-off-white); }

.apc-fuel-total td {
    font-weight: 700;
    color: var(--apc-ink);
    background: var(--apc-gold-pale);
    border-top: 2px solid var(--apc-gold-rule);
    border-bottom: none;
}

/* Tech stops */
.apc-tech-stops { background: var(--apc-white); padding-bottom: 1rem; }
.apc-tech-stops__list {
    padding: .5rem 1.75rem;
    font-size: .875rem;
    color: var(--apc-slate-mid);
}

/* Price section */
.apc-price-section {
    background: var(--apc-slate);
    padding: 1.5rem 1.75rem;
    border-top: 1px solid rgba(255,255,255,.07);
}

.apc-price-hero { text-align: center; margin-bottom: 1.25rem; }

.apc-price-hero__label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.4);
    margin-bottom: .4rem;
}

.apc-price-hero__value {
    font-family: var(--apc-f-serif);
    font-size: 2.75rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
    line-height: 1;
}

.apc-price-hero__note {
    font-size: .72rem;
    color: rgba(255,255,255,.3);
    margin-top: .35rem;
}

.apc-price-breakdown {
    max-width: 480px;
    margin: 0 auto 1.25rem;
}

.apc-breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: .45rem 0;
    font-size: .85rem;
    color: rgba(255,255,255,.5);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.apc-breakdown-row--total {
    color: var(--apc-white);
    font-weight: 600;
    font-size: .9rem;
    border-bottom: none;
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: .75rem;
}

.apc-price-cta { text-align: center; }

@media (max-width: 640px) {
    .apc-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .apc-stat { border-bottom: 1px solid rgba(255,255,255,.07); }
    .apc-results__header { padding: .875rem 1.25rem; }
    .apc-fuel-table th,
    .apc-fuel-table td { padding-left: 1rem; padding-right: 1rem; }
    .apc-section-label { padding-left: 1rem; }
    .apc-price-section { padding: 1.25rem 1rem; }
}

/* Sub-label under stat value (e.g. base time under wind-impacted time) */
.apc-stat__sub {
    font-size: .65rem;
    color: rgba(255,255,255,.4);
    margin-top: .15rem;
    min-height: .9rem;
}

/* ═══════════════════════════════════════════════
   Calculator Results Panel
═══════════════════════════════════════════════ */

.apc-results-panel {
    border-top: 2px solid var(--apc-gold-rule);
    margin-top: 1.25rem;
    animation: apc-slide-in .3s ease both;
}

/* Route header bar */
.apc-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    background: var(--apc-slate);
    padding: .875rem 1.25rem;
    border-radius: var(--apc-r-sm) var(--apc-r-sm) 0 0;
}

.apc-results-route {
    font-family: var(--apc-f-serif);
    font-size: 1.25rem;
    color: var(--apc-gold-rule);
    font-weight: 400;
    letter-spacing: .03em;
}

.apc-results-meta {
    display: flex;
    align-items: center;
    gap: .875rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: rgba(255,255,255,.5);
}

/* Primary stats grid */
.apc-res-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1px;
    background: var(--apc-rule);
    border: 1px solid var(--apc-rule);
    border-top: none;
}

.apc-res-stat {
    background: var(--apc-white);
    padding: 1.1rem 1rem;
    text-align: center;
    transition: background var(--apc-trans);
}

.apc-res-stat:hover { background: var(--apc-off-white); }

.apc-res-stat__icon  { font-size: 1.3rem; margin-bottom: .3rem; }

.apc-res-stat__label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--apc-stone);
    line-height: 1.3;
    margin-bottom: .35rem;
}

.apc-res-stat__value {
    font-family: var(--apc-f-serif);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--apc-ink);
}

/* Section shared styles */
.apc-section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
    display: block;
    margin-bottom: .75rem;
}

/* Fuel breakdown */
.apc-fuel-section,
.apc-tech-stops-row,
.apc-route-row {
    padding: 1.1rem 0;
    border-top: 1px solid var(--apc-rule);
}

.apc-fuel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .5rem;
}

.apc-fuel-item {
    background: var(--apc-off-white);
    border-radius: var(--apc-r-sm);
    padding: .625rem .875rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.apc-fuel-item__label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--apc-stone);
}

.apc-fuel-item__value {
    font-weight: 600;
    font-size: .9rem;
    color: var(--apc-ink);
}

/* Tech stops */
.apc-tech-stops-row {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    flex-wrap: wrap;
}

.apc-tech-stops-list-val {
    font-size: .85rem;
    color: var(--apc-slate-mid);
    font-weight: 500;
}

/* Route string */
.apc-route-string {
    font-family: monospace;
    font-size: .78rem;
    color: var(--apc-slate-soft);
    line-height: 1.7;
    word-break: break-all;
    background: var(--apc-off-white);
    border-radius: var(--apc-r-sm);
    padding: .75rem 1rem;
}

/* Price section */
.apc-price-section {
    background: var(--apc-slate);
    border-radius: 0 0 var(--apc-r-sm) var(--apc-r-sm);
    padding: 1.5rem;
    margin-top: 1px;
    border-top: 2px solid var(--apc-gold);
}

/* ─── Stats Bar (CTO confirmed response) ─────────────── */
.apc-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: var(--apc-slate);
    border-radius: var(--apc-r-sm);
    overflow: hidden;
    margin: 1.25rem 0 1rem;
    border: 1px solid rgba(255,255,255,.05);
}

.apc-stat-pill {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    flex: 1;
    min-width: 130px;
    border-right: 1px solid rgba(255,255,255,.08);
}

.apc-stat-pill:last-child { border-right: none; }
.apc-stat-pill--price { background: rgba(201,168,76,.08); }
.apc-stat-pill--link  { flex: 0 0 auto; padding: .75rem 1.25rem; align-items: center; justify-content: center; }

.apc-stat-pill__icon { font-size: 1.25rem; flex-shrink: 0; }

.apc-stat-pill__label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.4);
    margin-bottom: .2rem;
}

.apc-stat-pill__val {
    font-family: var(--apc-f-serif);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
    line-height: 1.1;
}

.apc-stat-pill__sub {
    font-size: .68rem;
    color: rgba(255,255,255,.35);
    margin-top: .1rem;
    min-height: .9rem;
}

/* ─── Fuel Detail Table ───────────────────────────────── */
.apc-fuel-table-wrap {
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

.apc-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--apc-gold);
    padding: .75rem 1rem;
    background: var(--apc-slate);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.apc-fuel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    background: var(--apc-white);
}

.apc-fuel-table th {
    background: var(--apc-off-white);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--apc-muted);
    padding: .5rem .875rem;
    text-align: left;
    border-bottom: 1px solid var(--apc-rule);
}

.apc-fuel-table td {
    padding: .45rem .875rem;
    border-bottom: 1px solid var(--apc-rule);
    color: var(--apc-text);
}

.apc-fuel-table tbody tr:last-child td { border-bottom: none; }
.apc-fuel-table tbody tr:hover { background: var(--apc-off-white); }

.apc-fuel-table tfoot td {
    background: var(--apc-slate);
    color: var(--apc-gold-rule);
    border-top: 2px solid rgba(255,255,255,.12);
    border-bottom: none;
    font-weight: 600;
}

/* ─── Tech stops notice ───────────────────────────────── */
.apc-tech-stops-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--apc-r-sm);
    padding: .75rem 1rem;
    font-size: .85rem;
    color: #92400e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ─── Iframe section ──────────────────────────────────── */
.apc-iframe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--apc-off-white);
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r-sm) var(--apc-r-sm) 0 0;
    flex-wrap: wrap;
    gap: .5rem;
}

.apc-iframe-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--apc-slate-mid);
}

.apc-iframe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    color: var(--apc-stone);
    font-size: .875rem;
    background: var(--apc-white);
}

.apc-calc-cta {
    text-align: center;
    padding: 1.25rem 0 .5rem;
    border-top: 1px solid var(--apc-rule);
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .apc-stats-bar { flex-direction: column; }
    .apc-stat-pill { border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
    .apc-stat-pill--link { justify-content: flex-start; }
    .apc-fuel-table { font-size: .75rem; }
    .apc-fuel-table th, .apc-fuel-table td { padding: .4rem .6rem; }
}

/* ─── Results Wrap ──────────────────────────────── */
.apc-results-wrap {
    border-top: 2px solid var(--apc-gold-rule);
    margin-top: 1.25rem;
    animation: apc-slide-in .3s ease both;
}

.apc-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--apc-rule);
    margin-bottom: 1.25rem;
}

.apc-results-route {
    font-family: var(--apc-f-serif);
    font-size: 1.4rem;
    color: var(--apc-ink);
    font-weight: 400;
}

/* ─── Stats Sections ────────────────────────────── */
.apc-stats-section {
    margin-bottom: 1.25rem;
}

.apc-section-title {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
    margin-bottom: .875rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--apc-rule);
}

.apc-stat__sub {
    font-size: .62rem;
    color: var(--apc-gold);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: .15rem;
}

/* ─── Price Section ─────────────────────────────── */
.apc-results-section--price {
    background: var(--apc-slate);
    border-radius: var(--apc-r-sm);
    padding: 1.5rem;
    margin-top: 1.25rem;
}

/* ─── Results wrap ────────────────────────────────── */
.apc-results-wrap {
    border-top: 2px solid var(--apc-gold-rule);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    animation: apc-slide-in .3s ease both;
}

.apc-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

.apc-results-route {
    font-family: var(--apc-f-serif);
    font-size: 1.3rem;
    color: var(--apc-ink);
    font-weight: 400;
}

/* ─── Stat sub-label ───────────────────────────────── */
.apc-stat__sub {
    font-size: .65rem;
    color: var(--apc-stone);
    margin-top: .15rem;
    min-height: .9rem;
}

/* ─── Price section (dark) ─────────────────────────── */
.apc-price-section {
    background: var(--apc-slate);
    border-radius: var(--apc-r-sm);
    padding: 1.5rem;
    margin-top: 1rem;
}

/* ─── CTA ──────────────────────────────────────────── */
.apc-calc-cta {
    text-align: center;
    padding: 1.25rem 0 .25rem;
}

/* ─── Advanced grid ────────────────────────────────── */
.apc-advanced-panel {
    background: var(--apc-off-white);
    border: 1.5px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    padding: 1.25rem;
    margin-top: .75rem;
}

.apc-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.apc-field-hint {
    font-size: .68rem;
    color: var(--apc-stone);
    margin: .25rem 0 0;
    line-height: 1.4;
}

/* ─── Secondary button ─────────────────────────────── */
.apc-btn--secondary {
    background: transparent;
    color: var(--apc-slate-mid);
    border: 1.5px solid var(--apc-rule);
}

.apc-btn--secondary:hover {
    border-color: var(--apc-gold);
    color: var(--apc-gold);
    background: var(--apc-gold-pale);
}

@keyframes apc-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Results header bar ─────────────────────────── */
.apc-results__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 0 .875rem;
    border-bottom: 1px solid var(--apc-rule);
    margin-bottom: 1rem;
}

.apc-results__route {
    font-family: var(--apc-f-serif);
    font-size: 1.35rem;
    color: var(--apc-ink);
    font-weight: 400;
    letter-spacing: .01em;
}

.apc-results__section {
    padding: 1rem 0;
    border-bottom: 1px solid var(--apc-rule);
}

.apc-results__section:last-child { border-bottom: none; }

.apc-results__section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
    margin-bottom: .875rem;
}

/* Subtle sub-label on stat cards */
.apc-stat__sub {
    font-size: .6rem;
    color: var(--apc-stone);
    margin-top: .15rem;
    font-style: italic;
}

/* ─── Results panel ───────────────────────────────── */
.apc-results-panel {
    border-top: 2px solid var(--apc-gold);
    animation: apc-slide-in .3s ease both;
}

.apc-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .875rem;
    padding: 1rem 1.75rem;
    background: var(--apc-slate);
}

.apc-results-header__route {
    display: flex;
    align-items: center;
    gap: .875rem;
}

.apc-results-header__from,
.apc-results-header__to {
    font-family: var(--apc-f-serif);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
}

.apc-results-header__arrow {
    color: rgba(255,255,255,.4);
    font-size: 1.25rem;
}

.apc-results-header__meta {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .8rem;
    color: rgba(255,255,255,.5);
}

/* Sub-labels under stat values */
.apc-stat__sub {
    font-size: .68rem;
    color: var(--apc-stone);
    margin-top: .2rem;
    min-height: .9rem;
}

/* Section title inside results */
.apc-results__section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--apc-gold);
}

/* Fuel detail table wrapper */
.apc-fuel-table {
    background: var(--apc-white);
    border: 1px solid var(--apc-rule);
    border-radius: var(--apc-r-sm);
    overflow: hidden;
}

@media (max-width: 640px) {
    .apc-results-header { flex-direction: column; align-items: flex-start; }
    .apc-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Results header ICAO badges */
.apc-results-header__icao {
    font-family: var(--apc-f-serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--apc-gold-rule);
    letter-spacing: .02em;
}

/* ─── Route map ───────────────────────────────────── */
#res-map-wrap {
    border-bottom: 1px solid var(--apc-rule);
}

#res-map {
    z-index: 0; /* keep below dropdowns */
}

/* Leaflet marker label override */
.leaflet-div-icon { background: none !important; border: none !important; }


/* ════════════════════════════════════════════
   HIDE: Advanced Settings button
   HIDE: Price & Route / Route Only tab buttons
   Use high-specificity selectors to override
   any theme CSS that might conflict.
════════════════════════════════════════════ */
.apc-widget .apc-advanced-toggle,
.apc-widget .apc-advanced-toggle:hover,
button.apc-advanced-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.apc-widget .apc-mode-tabs,
.apc-widget__header .apc-mode-tabs,
div.apc-mode-tabs {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ═══════════════════════════════════════════════════
   CUSTOM BRANDING OVERRIDES
   ═══════════════════════════════════════════════════ */

/* 1. Widget header background: #144D41 */
.apc-widget__header,
.apc-results-header,
.apc-quickstats,
#apc-quickstats,
.apc-results-panel .apc-results-header {
    background: #144D41 !important;
}

/* 2. Widget title font colour: #FFFFFF */
.apc-widget__title {
    color: #ffffff !important;
}

/* 3. Widget title font: Montserrat (load from Google Fonts) */

.apc-widget__title,
.apc-widget .apc-widget__title {
    font-family: inherit;
}

/* ─── Custom branding overrides ──────────────────── */

/* 1. Header background: #292524 → #144D41 */
.apc-widget__header,
.apc-results-header,
.apc-results__section--price,
#apc-quickstats {
    background: #144D41 !important;
    background-image: none !important;
}

/* Route header bar (dark bar with ICAO codes) */
.apc-results-panel .apc-results-header {
    background: #144D41 !important;
}

/* Stat cards dark background */
.apc-results-panel .apc-stats-grid {
    background: #144D41 !important;
}
.apc-results-panel .apc-results__section--price {
    background: #144D41 !important;
}

/* 2. Widget title & header text: → #FFFFFF */
.apc-widget__title,
.apc-widget__header,
.apc-widget__header * {
    color: #FFFFFF !important;
}

/* 3. Heading font: DM Serif Display → Montserrat */

.apc-widget .apc-widget__title,
.apc-widget .apc-results-header__icao,
.apc-widget .apc-price-hero__value,
.apc-widget .apc-stat__value,
.apc-widget h1, .apc-widget h2, .apc-widget h3, .apc-widget h4 {
    font-family: inherit;
}
