/* ══════════════════════════════════════════════════
   APPS V2 — Weather, ATIS, NOTAMs
   Same "document, not dashboard-tile" language as the
   OFP Planner recode: manifest rows instead of pill
   grids, and de-emphasised chrome around authentic raw
   text (METAR/TAF/ATIS) which reads fine as-is.
══════════════════════════════════════════════════ */

@keyframes pulse{
    0%,100%{ opacity:1 }
    50%{ opacity:.4 }
}

/* ── Weather ── */
.wx-card{
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    padding: 14px;
    background: var(--paper);
}
.wx-card-hdr{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.wx-card-icao{
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
}
.wx-recent-row{
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.wx-recent-chip{
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--paper2);
    border: 1px solid var(--line2);
    border-radius: 999px;
    padding: 5px 11px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.wx-recent-chip:hover{ border-color: var(--log-red); color: var(--log-red); background: var(--log-red-tint); }

/* ── ATIS ── */
.atis-box-hdr{
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.atis-letter-inline{
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0891b2, #0e3a3a);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm, 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.atis-callsign{
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.atis-live-dot{
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #178a4c;
    font-weight: 600;
    margin-top: 2px;
}
.atis-live-dot span{
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74,222,128,.6);
    animation: pulse 2s infinite;
}

/* ── NOTAMs ── */
.ntm-hdr{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.ntm-date{
    font-size: 9.5px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
}
/* Severity accent — left border colour communicates urgency at a glance without another pill/badge */
.ntm-card{ border-left: 3px solid #d97706; }
.ntm-sev-critical, .ntm-sev-high{ border-left-color: var(--log-red); background: rgba(200,16,46,.04); }
.ntm-sev-critical .ntm-title, .ntm-sev-high .ntm-title{ color: var(--log-red); }
.ntm-sev-warning, .ntm-sev-medium{ border-left-color: #d97706; }
.ntm-sev-info, .ntm-sev-low{ border-left-color: var(--accent-blue, #2563eb); background: rgba(37,99,235,.04); }
.ntm-sev-info .ntm-title, .ntm-sev-low .ntm-title{ color: var(--accent-blue, #2563eb); }

/* ── Roster ── */
.roster-summary{
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--paper2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 10px);
}

/* Icon glyphs have their own built-in padding within the SVG viewBox (normal
   icon design), which reads as "small icon, big empty tile" at this size.
   Scaling up and letting the tile's existing overflow:hidden crop it gives a
   fuller, more confident look without needing to touch every icon's path data. */
.app-ico svg{
    transform: scale(1.32);
    transform-origin: center;
}
.app-ico img{
    transform: scale(1.06); /* uploaded icons already object-fit:cover; tiny nudge closes the visible edge margin */
}
.av-ico svg{
    transform: scale(1.25);
    transform-origin: center;
}
.as-card-ico svg{
    transform: scale(1.25);
    transform-origin: center;
}

.app-lbl{
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 84px !important;
    line-height: 1.25 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Dispatch app: side-tab layout ── */
.dispatch-layout{
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}
.dispatch-sidetabs{
    width: 84px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 8px;
    background: var(--paper3);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}
.dispatch-tab{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 12px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-faint);
    cursor: pointer;
    transition: all .15s;
}
.dispatch-tab-ico{ display: flex; align-items: center; justify-content: center; }
.dispatch-tab-ico svg{ width: 18px; height: 18px; }
.dispatch-tab.active{
    background: var(--paper);
    color: var(--log-red);
    box-shadow: 0 1px 4px rgba(22,35,60,.1);
}
.dispatch-content{
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}
.dispatch-pane{ display: none; }
.dispatch-pane.active{ display: block; }
.dispatch-state{
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
}
.dispatch-state-ico{
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    background: var(--paper2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.dispatch-state-ico.error{ background: rgba(200,16,46,.12); }
.dispatch-state-title{
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}
.dispatch-state-body{
    font-size: 12px;
    color: var(--ink-faint);
    line-height: 1.5;
    max-width: 280px;
}
.accent-swatch{
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
    transition: transform .12s;
}
.accent-swatch:active{ transform: scale(.92); }
.accent-swatch.active{
    border-color: var(--ink);
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}
.crew-card{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    margin-bottom: 8px;
    background: var(--paper);
}
.crew-avatar{
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.crew-name{ font-size: 13px; font-weight: 700; color: var(--ink); }
.crew-role{ font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }
.prm-card{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    margin-bottom: 8px;
    background: var(--paper);
}
.prm-badge{
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--paper2);
    flex-shrink: 0;
}
.prm-code{ font-size: 12.5px; font-weight: 800; color: var(--log-red); }
.prm-desc{ font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }
.prm-name{ font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }

.doc-viewer-overlay{
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    background: var(--paper);
}
.gsx-hdr{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--log-red), #7c0a1f);
    flex-shrink: 0;
}
.gsx-hdr-ico{
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gsx-hdr-ico svg{ width: 20px; height: 20px; }
.gsx-hdr-title{ font-size: 14px; font-weight: 800; color: #fff; }
.gsx-hdr-sub{ font-size: 10.5px; color: rgba(255,255,255,.8); margin-top: 1px; }

/* ── Weather redesign ── */
.wx-pill-row{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.wx-pill{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--paper2);
    cursor: pointer;
    font-family: inherit;
}
.wx-pill.active{
    background: var(--log-red-tint, rgba(200,16,46,.1));
    border-color: var(--log-red);
}
.wx-pill-icao{ font-size: 13px; font-weight: 800; color: var(--ink); }
.wx-pill.active .wx-pill-icao{ color: var(--log-red); }
.wx-pill-label{ font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-top: 1px; }
.wx-pill-input{
    width: 64px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--paper2);
    color: var(--ink);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.wx-pill-add{
    width: 34px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--paper2);
    color: var(--ink-soft);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.wx-hero{
    text-align: center;
    padding: 20px 16px 24px;
    border-radius: var(--radius-lg, 20px);
    background: linear-gradient(160deg, #1e3a6e, #0d1f3f);
    color: #fff;
    margin-bottom: 12px;
}
.wx-hero-loc{ font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.wx-hero-name{ font-size: 22px; font-weight: 800; margin-top: 6px; }
.wx-hero-temp{ font-size: 14px; font-weight: 600; opacity: .85; margin-top: 10px; }
.wx-hero-ico{ font-size: 46px; margin-top: 10px; }
.wx-condition-banner{
    margin: 16px 20px 0;
    padding: 10px 16px;
    background: rgba(255,255,255,.12);
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
}

.wx-hourly-strip{
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 14px 4px;
    margin-bottom: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
}
.wx-hourly-item{
    flex-shrink: 0;
    width: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wx-hourly-time{ font-size: 9.5px; font-weight: 700; color: var(--ink-faint); }
.wx-hourly-ico{ font-size: 18px; }
.wx-hourly-temp{ font-size: 12px; font-weight: 800; color: var(--ink); }

.wx-daily-card{
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    padding: 14px 16px;
}
.wx-daily-row{
    display: grid;
    grid-template-columns: 48px 34px 26px 1fr 26px;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}
.wx-daily-row:first-of-type{ border-top: none; }
.wx-daily-day{ font-size: 12.5px; font-weight: 700; color: var(--ink); }
.wx-daily-ico{ font-size: 15px; text-align: center; position: relative; }
.wx-daily-pop{ font-size: 8px; font-weight: 700; color: #4d94ff; margin-top: 1px; }
.wx-daily-lo{ font-size: 11.5px; color: var(--ink-faint); text-align: right; }
.wx-daily-hi{ font-size: 11.5px; font-weight: 700; color: var(--ink); text-align: left; }
.wx-daily-bar-track{
    position: relative;
    height: 4px;
    border-radius: 2px;
    background: var(--paper3, var(--paper2));
}
.wx-daily-bar{
    position: absolute;
    top: 0; height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #4d94ff, #fbbf24, #f97316);
}
.doc-card{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    margin-bottom: 8px;
    background: var(--paper);
    cursor: pointer;
    transition: transform .1s;
}
.doc-card:active{ transform: scale(.98); }
.doc-card-ico{
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--paper2);
    flex-shrink: 0;
}
.doc-card-title{ font-size: 13px; font-weight: 700; color: var(--ink); }
.doc-card-meta{ font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }

/* ── Leaderboard ── */
.lb-row{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    margin-bottom: 8px;
    background: var(--paper);
}
.lb-row-top{
    background: linear-gradient(135deg, rgba(184,134,11,.1), rgba(184,134,11,.02));
    border-color: rgba(184,134,11,.35);
}
.lb-rank{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--paper2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink-soft);
    flex-shrink: 0;
}
.lb-row-top .lb-rank{ background: transparent; font-size: 20px; }
.lb-row-me{
    border-color: var(--accent-blue, #2563eb) !important;
    background: var(--accent-blue-tint, rgba(37,99,235,.08)) !important;
}
.lb-you-tag{
    display: inline-block;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
    background: var(--accent-blue, #2563eb);
    padding: 2px 6px;
    border-radius: 5px;
    vertical-align: middle;
    margin-left: 5px;
}
.lb-you-footer{
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.lb-name{ font-size: 13.5px; font-weight: 700; color: var(--ink); }
.lb-stats{ font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

.beta-badge{
    display: inline-block;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
    background: linear-gradient(135deg,#7c3aed,#4c1d95);
    padding: 2px 6px;
    border-radius: 5px;
    vertical-align: middle;
    margin-left: 4px;
}

.custom-embed-bar{
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    background: var(--paper2);
    border-bottom: 1px solid var(--line);
    font-size: 10.5px;
    color: var(--ink-faint);
}

/* ══════════════════════════════════════════════════
   SETTINGS — Apple Settings-app language: colored icon
   squares per row, generous grouped-list spacing, a
   Loganair red accent kept for brand-relevant actions
   (Full Pilot Settings, the destructive Exit action).
══════════════════════════════════════════════════ */
.stg-list{
    border-radius: var(--radius-lg, 20px) !important;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.stg-section{
    padding: 18px 16px 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .04em !important;
}
.stg-row{
    padding: 11px 16px !important;
    min-height: 44px; /* Apple's own minimum tap-target height */
}
.stg-lbl{
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 14px;
}
.stg-icn{
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.stg-icn svg{
    width: 16px;
    height: 16px;
}
.stg-select{
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    background: transparent;
    border: none;
    text-align: right;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 4px;
    font-family: inherit;
    cursor: pointer;
}
.stg-select:focus{ outline: none; color: var(--log-red); }

.whatsnew-overlay{
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: efbTileIn .25s ease both;
}
.whatsnew-card{
    background: var(--paper);
    border-radius: var(--radius-lg, 20px);
    padding: 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.whatsnew-hdr{
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 12px;
}
.whatsnew-body{
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin-bottom: 18px;
    white-space: pre-line;
}
.whatsnew-release{
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.whatsnew-release:first-of-type{ border-top: none; padding-top: 4px; }
.whatsnew-version{
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
}
.whatsnew-version span{
    font-weight: 500;
    color: var(--ink-faint);
    font-size: 11px;
}
.whatsnew-entry{
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-bottom: 7px;
    line-height: 1.4;
}
.whatsnew-entry-badge{
    flex-shrink: 0;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    margin-top: 1px;
}

/* ── Weight & Balance ── */
.wnb-section-toggle{
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-soft);
    padding: 10px 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}
.wnb-section-hdr{
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-soft);
    padding: 10px 4px;
    border-bottom: 1px solid var(--line);
    margin: 14px 0 10px;
}
.wnb-envelope-hdr{
    font-size: 10.5px;
    color: var(--ink-faint);
    margin: 12px 0 6px;
}
.wnb-stations{
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    overflow: hidden;
}
.wnb-station-hdr-row{
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 8px;
    padding: 6px 12px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-faint);
    background: var(--paper2);
}
.wnb-station-row{
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: var(--paper);
}
.wnb-station-name{ font-size: 12px; color: var(--ink); font-weight: 600; line-height: 1.3; }
.wnb-arm-input, .wnb-wt-input{
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--line2);
    border-radius: 8px;
    background: var(--paper2);
    color: var(--ink);
    font-family: inherit;
    width: 100%;
}
.wnb-arm-input:focus, .wnb-wt-input:focus{ outline: none; border-color: var(--accent-blue, #2563eb); }

.wnb-envelope-card{
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 14px);
    padding: 14px;
    background: var(--paper);
}
.wnb-envelope-legend{
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 8px;
}
.wnb-envelope-legend span{
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Loadsheet ── */
.loadsheet-hdr{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.loadsheet-reg{ font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.loadsheet-type{ font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }
.loadsheet-route{ font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.loadsheet-signed{
    font-size: 12px;
    font-weight: 600;
    color: #178a4c;
    background: rgba(23,138,76,.08);
    border: 1px solid rgba(23,138,76,.25);
    border-radius: var(--radius-sm, 10px);
    padding: 10px 12px;
    text-align: center;
}
