/* ============================================================
   Aircraft Intelligence - TriVector Labs
   Global Stylesheet
   ============================================================ */

:root {
    --tv-navy: #1a1a1a;
    --tv-navy-light: #2a2a2a;
    --tv-blue: #2d68ea;
    --tv-accent: #2d68ea;
    --tv-cyan: #ffb30b;
    --tv-surface: #f0f4f8;
    --tv-card: #ffffff;
    --tv-text: #1e293b;
    --tv-text-muted: #64748b;
    --tv-border: #e2e8f0;
}

html, body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--tv-surface);
    color: var(--tv-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Module Tab Bar */
.module-tab-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--tv-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 1rem;
    font-family: 'Inter', sans-serif;
}

.module-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.module-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.module-tab.active {
    color: #ffffff;
    border-bottom-color: var(--tv-cyan);
}

.module-tab.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Module-tab icon — blue circular badge with the brand mark recolored to white.
   Uses CSS mask-image instead of an <img> + filter so there's no DOM element to
   re-instantiate during Blazor enhanced navigation. The blue background is on the
   span itself; the ::before pseudo-element paints a white block masked by the SVG
   shape, producing "white mark on blue circle".  Other render sites (chat avatar,
   dashboard table, sidebar logo, etc.) continue using <img src=...> on a white
   background — only the tab bar uses this inverted treatment. */
.module-tab-icon {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2d68ea;
    flex-shrink: 0;
    vertical-align: middle;
}

.module-tab-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    /* mask-image is set per-icon via [data-icon="..."] rules below */
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* The mask-image URLs are INLINE data URIs (not /foo.svg file refs) by deliberate choice —
   when CSS loads with a url('/foo.svg') mask, Chromium has a brief paint window where the
   ::before renders its solid white background BEFORE the mask SVG arrives, surfacing as
   the "icon is just a white blob" symptom users keep reporting.  With the SVG inlined as
   a data URI the mask is part of the CSS rule itself — no network fetch, no paint race,
   no cache invalidation, no Blazor-enhanced-navigation timing window.  TO REGENERATE
   THESE after editing an avatar SVG file in wwwroot/, run the helper at the bottom of
   this file's CSS comments (the PowerShell minifier + URL-encode pipeline). */
.module-tab-icon[data-icon="avia"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cg%3E%3Cpath class=%22cls-1%22 d=%22M204.8240863,93.7214387c-2.2359999-1.1287811-4.72859-1.8241619-7.4044588-1.8241619H67.3036224c-9.1369814,0-16.5435963,7.406615-16.5435963,16.5430573v130.1157356c0,2.5960886.6511784,5.0202187,1.7174291,7.2066256,78.1500301-35.6374616,135.0753107-123.0204249,152.3466312-152.0412566Z%22/%3E%3Cpath class=%22cls-1%22 d=%22M133.2979634,255.0991269h64.1216641c9.1359033,0,16.5425182-7.406615,16.5425182-16.5430573V108.440334c0-3.9954753-1.4737762-7.6106473-3.8316026-10.4697947-34.1113971,102.8023605-64.1928194,143.4347053-76.8325798,157.1285876Z%22/%3E%3C/g%3E%3Cpath class=%22cls-1%22 d=%22M217.5530595,70.690801l-17.4217918,2.1898276c-2.4195938.3041302-3.8541331-2.6261532-2.1298953-4.3506627l34.8673097-34.872805c1.6587941-1.6590555,4.4897433-.3991295,4.3674567,1.9437553l-2.5704226,49.2466724c-.127111,2.4353177-3.2643695,3.3309029-4.6579637,1.3296971l-10.0342907-14.4092743c-.5438829-.7810176-1.4760989-1.1959043-2.4204023-1.0772104Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cg%3E%3Cpath class=%22cls-1%22 d=%22M204.8240863,93.7214387c-2.2359999-1.1287811-4.72859-1.8241619-7.4044588-1.8241619H67.3036224c-9.1369814,0-16.5435963,7.406615-16.5435963,16.5430573v130.1157356c0,2.5960886.6511784,5.0202187,1.7174291,7.2066256,78.1500301-35.6374616,135.0753107-123.0204249,152.3466312-152.0412566Z%22/%3E%3Cpath class=%22cls-1%22 d=%22M133.2979634,255.0991269h64.1216641c9.1359033,0,16.5425182-7.406615,16.5425182-16.5430573V108.440334c0-3.9954753-1.4737762-7.6106473-3.8316026-10.4697947-34.1113971,102.8023605-64.1928194,143.4347053-76.8325798,157.1285876Z%22/%3E%3C/g%3E%3Cpath class=%22cls-1%22 d=%22M217.5530595,70.690801l-17.4217918,2.1898276c-2.4195938.3041302-3.8541331-2.6261532-2.1298953-4.3506627l34.8673097-34.872805c1.6587941-1.6590555,4.4897433-.3991295,4.3674567,1.9437553l-2.5704226,49.2466724c-.127111,2.4353177-3.2643695,3.3309029-4.6579637,1.3296971l-10.0342907-14.4092743c-.5438829-.7810176-1.4760989-1.1959043-2.4204023-1.0772104Z%22/%3E%3C/svg%3E");
}
.module-tab-icon[data-icon="aviaintel"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cpath class=%22cls-1%22 d=%22M217.9863697,63.1677672H70.0147084c-3.8952111,0-7.054073,3.1577839-7.054073,7.0532645v39.7817161c0,3.8952111,3.158862,7.0532645,7.054073,7.0532645h47.2481662v46.834711c0,3.8954806,3.1577839,7.0532645,7.0529949,7.0532645h46.8352501v46.8349805c0,3.8954806,3.1577839,7.0532645,7.0529949,7.0532645h39.7822551c3.8952111,0,7.0529949-3.1577839,7.0529949-7.0532645V70.2210317c0-3.8954806-3.1577839-7.0532645-7.0529949-7.0532645Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cpath class=%22cls-1%22 d=%22M217.9863697,63.1677672H70.0147084c-3.8952111,0-7.054073,3.1577839-7.054073,7.0532645v39.7817161c0,3.8952111,3.158862,7.0532645,7.054073,7.0532645h47.2481662v46.834711c0,3.8954806,3.1577839,7.0532645,7.0529949,7.0532645h46.8352501v46.8349805c0,3.8954806,3.1577839,7.0532645,7.0529949,7.0532645h39.7822551c3.8952111,0,7.0529949-3.1577839,7.0529949-7.0532645V70.2210317c0-3.8954806-3.1577839-7.0532645-7.0529949-7.0532645Z%22/%3E%3C/svg%3E");
}
.module-tab-icon[data-icon="aviams"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cpath class=%22cls-1%22 d=%22M231.2880312,187.8142308v-.0001204c-34.6422305-27.0595184-57.4215408-66.5148014-63.5349889-110.0453152v-.0002407c-3.8665224-27.533987-43.6395622-27.533987-47.5060846,0v.0002407c-6.1134481,43.5305139-28.8929991,82.9857969-63.5349889,110.0453152v.0001204c-21.911738,17.115777-2.0254588,51.5600113,23.7530423,41.1416809h.0002407c40.7551972-16.4711158,86.3142993-16.4711158,127.0694964,0h.0002407c25.7785011,10.4183304,45.6647803-24.0259039,23.7530423-41.1416809ZM144,68.3560928c6.5891204,0,11.9305639,5.3415639,11.9305639,11.9306842s-5.3414435,11.9306842-11.9305639,11.9306842-11.9305639-5.3415639-11.9305639-11.9306842,5.3414435-11.9306842,11.9305639-11.9306842ZM69.9961284,219.5820864c-6.5891204,0-11.9308046-5.3415639-11.9308046-11.9306842s5.3416842-11.9306842,11.9308046-11.9306842,11.9305639,5.3415639,11.9305639,11.9306842-5.3414435,11.9306842-11.9305639,11.9306842ZM144,189.5019527c-13.6170821,0-24.6557605-11.0387987-24.6557605-24.6557605s11.0386783-24.6556401,24.6557605-24.6556401,24.6557605,11.0386783,24.6557605,24.6556401-11.0386783,24.6557605-24.6557605,24.6557605ZM217.0710628,219.5820864c-6.5891204,0-11.9305639-5.3415639-11.9305639-11.9306842s5.3414435-11.9306842,11.9305639-11.9306842,11.9305639,5.3415639,11.9305639,11.9306842-5.3414435,11.9306842-11.9305639,11.9306842Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cpath class=%22cls-1%22 d=%22M231.2880312,187.8142308v-.0001204c-34.6422305-27.0595184-57.4215408-66.5148014-63.5349889-110.0453152v-.0002407c-3.8665224-27.533987-43.6395622-27.533987-47.5060846,0v.0002407c-6.1134481,43.5305139-28.8929991,82.9857969-63.5349889,110.0453152v.0001204c-21.911738,17.115777-2.0254588,51.5600113,23.7530423,41.1416809h.0002407c40.7551972-16.4711158,86.3142993-16.4711158,127.0694964,0h.0002407c25.7785011,10.4183304,45.6647803-24.0259039,23.7530423-41.1416809ZM144,68.3560928c6.5891204,0,11.9305639,5.3415639,11.9305639,11.9306842s-5.3414435,11.9306842-11.9305639,11.9306842-11.9305639-5.3415639-11.9305639-11.9306842,5.3414435-11.9306842,11.9305639-11.9306842ZM69.9961284,219.5820864c-6.5891204,0-11.9308046-5.3415639-11.9308046-11.9306842s5.3416842-11.9306842,11.9308046-11.9306842,11.9305639,5.3415639,11.9305639,11.9306842-5.3414435,11.9306842-11.9305639,11.9306842ZM144,189.5019527c-13.6170821,0-24.6557605-11.0387987-24.6557605-24.6557605s11.0386783-24.6556401,24.6557605-24.6556401,24.6557605,11.0386783,24.6557605,24.6556401-11.0386783,24.6557605-24.6557605,24.6557605ZM217.0710628,219.5820864c-6.5891204,0-11.9305639-5.3415639-11.9305639-11.9306842s5.3414435-11.9306842,11.9305639-11.9306842,11.9305639,5.3415639,11.9305639,11.9306842-5.3414435,11.9306842-11.9305639,11.9306842Z%22/%3E%3C/svg%3E");
}
.module-tab-icon[data-icon="aviaplus"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cpath class=%22cls-1%22 d=%22M215.4797642,110.041964h-4.9172592s-44.3825501,14.9116075-67.916611,67.9163414h-32.6031213v37.5217282c0,4.6261696,3.7496662,8.3763748,8.3758358,8.3763748h51.1638613c4.6261696,0,8.3758358-3.7502053,8.3758358-8.3763748v-37.5217282h37.5214587c4.6272477,0,8.3769139-3.7504748,8.3769139-8.3766444v-51.1633223c0-4.6261696-3.7496662-8.3763748-8.3769139-8.3763748Z%22/%3E%3Cpath class=%22cls-1%22 d=%22M97.7264452,139.1660248l.0086249.0078163c10.9288-15.2247984,26.05576-29.131877,44.9108239-29.131877h35.3124115v-37.5219977c0-4.6261696-3.7496662-8.3763748-8.3758358-8.3763748h-51.1638613c-4.6261696,0-8.3758358,3.7502053-8.3758358,8.3763748v37.5219977h-37.5225368c-4.6261696,0-8.3769139,3.7502053-8.3769139,8.3763748v50.9468917c17.9817949-11.4247306,33.5831232-30.1992058,33.5831232-30.1992058Z%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 288 288%22%3E%3Cdefs%3E%3Cstyle%3E .cls-1 { fill: %232d68ea; } %3C/style%3E%3C/defs%3E%3Cpath class=%22cls-1%22 d=%22M215.4797642,110.041964h-4.9172592s-44.3825501,14.9116075-67.916611,67.9163414h-32.6031213v37.5217282c0,4.6261696,3.7496662,8.3763748,8.3758358,8.3763748h51.1638613c4.6261696,0,8.3758358-3.7502053,8.3758358-8.3763748v-37.5217282h37.5214587c4.6272477,0,8.3769139-3.7504748,8.3769139-8.3766444v-51.1633223c0-4.6261696-3.7496662-8.3763748-8.3769139-8.3763748Z%22/%3E%3Cpath class=%22cls-1%22 d=%22M97.7264452,139.1660248l.0086249.0078163c10.9288-15.2247984,26.05576-29.131877,44.9108239-29.131877h35.3124115v-37.5219977c0-4.6261696-3.7496662-8.3763748-8.3758358-8.3763748h-51.1638613c-4.6261696,0-8.3758358,3.7502053-8.3758358,8.3763748v37.5219977h-37.5225368c-4.6261696,0-8.3769139,3.7502053-8.3769139,8.3763748v50.9468917c17.9817949-11.4247306,33.5831232-30.1992058,33.5831232-30.1992058Z%22/%3E%3C/svg%3E");
}
.module-tab-icon[data-icon="aviaconnect"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 48%22 fill=%22none%22%3E%3Cdefs%3E%3ClinearGradient id=%22gwGrad%22 x1=%220%25%22 y1=%220%25%22 x2=%22100%25%22 y2=%22100%25%22%3E%3Cstop offset=%220%25%22 style=%22stop-color:%233b82f6%22/%3E%3Cstop offset=%22100%25%22 style=%22stop-color:%2306b6d4%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%2224%22 fill=%22url(%23gwGrad)%22/%3E%3Cline x1=%2212%22 y1=%2220%22 x2=%2236%22 y2=%2220%22 stroke=%22white%22 stroke-width=%222%22 stroke-linecap=%22round%22 opacity=%220.9%22/%3E%3Cpolyline points=%2231,16 36,20 31,24%22 stroke=%22white%22 stroke-width=%222%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 opacity=%220.9%22/%3E%3Cline x1=%2236%22 y1=%2228%22 x2=%2212%22 y2=%2228%22 stroke=%22white%22 stroke-width=%222%22 stroke-linecap=%22round%22 opacity=%220.9%22/%3E%3Cpolyline points=%2217,24 12,28 17,32%22 stroke=%22white%22 stroke-width=%222%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 opacity=%220.9%22/%3E%3Ccircle cx=%2212%22 cy=%2220%22 r=%222.5%22 fill=%22white%22 opacity=%220.7%22/%3E%3Ccircle cx=%2236%22 cy=%2228%22 r=%222.5%22 fill=%22white%22 opacity=%220.7%22/%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%222%22 fill=%22white%22 opacity=%220.5%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 48%22 fill=%22none%22%3E%3Cdefs%3E%3ClinearGradient id=%22gwGrad%22 x1=%220%25%22 y1=%220%25%22 x2=%22100%25%22 y2=%22100%25%22%3E%3Cstop offset=%220%25%22 style=%22stop-color:%233b82f6%22/%3E%3Cstop offset=%22100%25%22 style=%22stop-color:%2306b6d4%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%2224%22 fill=%22url(%23gwGrad)%22/%3E%3Cline x1=%2212%22 y1=%2220%22 x2=%2236%22 y2=%2220%22 stroke=%22white%22 stroke-width=%222%22 stroke-linecap=%22round%22 opacity=%220.9%22/%3E%3Cpolyline points=%2231,16 36,20 31,24%22 stroke=%22white%22 stroke-width=%222%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 opacity=%220.9%22/%3E%3Cline x1=%2236%22 y1=%2228%22 x2=%2212%22 y2=%2228%22 stroke=%22white%22 stroke-width=%222%22 stroke-linecap=%22round%22 opacity=%220.9%22/%3E%3Cpolyline points=%2217,24 12,28 17,32%22 stroke=%22white%22 stroke-width=%222%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 opacity=%220.9%22/%3E%3Ccircle cx=%2212%22 cy=%2220%22 r=%222.5%22 fill=%22white%22 opacity=%220.7%22/%3E%3Ccircle cx=%2236%22 cy=%2228%22 r=%222.5%22 fill=%22white%22 opacity=%220.7%22/%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%222%22 fill=%22white%22 opacity=%220.5%22/%3E%3C/svg%3E");
}
.module-tab-icon[data-icon="aviapolicy"]::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 48%22 fill=%22none%22%3E%3Cdefs%3E%3ClinearGradient id=%22polGrad%22 x1=%220%25%22 y1=%220%25%22 x2=%22100%25%22 y2=%22100%25%22%3E%3Cstop offset=%220%25%22 style=%22stop-color:%233b82f6%22/%3E%3Cstop offset=%22100%25%22 style=%22stop-color:%2306b6d4%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%2224%22 fill=%22url(%23polGrad)%22/%3E%3Cpath d=%22M24 10 L33 14 L33 24 C33 30 29 34.5 24 37 C19 34.5 15 30 15 24 L15 14 Z%22 stroke=%22white%22 stroke-width=%222%22 fill=%22none%22 stroke-linejoin=%22round%22 opacity=%220.9%22/%3E%3Cline x1=%2220%22 y1=%2219%22 x2=%2228%22 y2=%2219%22 stroke=%22white%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 opacity=%220.6%22/%3E%3Cline x1=%2220%22 y1=%2223%22 x2=%2228%22 y2=%2223%22 stroke=%22white%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 opacity=%220.6%22/%3E%3Cline x1=%2220%22 y1=%2227%22 x2=%2226%22 y2=%2227%22 stroke=%22white%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 opacity=%220.6%22/%3E%3Cpolyline points=%2221,31 23,33 28,28%22 stroke=%22white%22 stroke-width=%221.8%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 opacity=%220.8%22/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 48 48%22 fill=%22none%22%3E%3Cdefs%3E%3ClinearGradient id=%22polGrad%22 x1=%220%25%22 y1=%220%25%22 x2=%22100%25%22 y2=%22100%25%22%3E%3Cstop offset=%220%25%22 style=%22stop-color:%233b82f6%22/%3E%3Cstop offset=%22100%25%22 style=%22stop-color:%2306b6d4%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%2224%22 fill=%22url(%23polGrad)%22/%3E%3Cpath d=%22M24 10 L33 14 L33 24 C33 30 29 34.5 24 37 C19 34.5 15 30 15 24 L15 14 Z%22 stroke=%22white%22 stroke-width=%222%22 fill=%22none%22 stroke-linejoin=%22round%22 opacity=%220.9%22/%3E%3Cline x1=%2220%22 y1=%2219%22 x2=%2228%22 y2=%2219%22 stroke=%22white%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 opacity=%220.6%22/%3E%3Cline x1=%2220%22 y1=%2223%22 x2=%2228%22 y2=%2223%22 stroke=%22white%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 opacity=%220.6%22/%3E%3Cline x1=%2220%22 y1=%2227%22 x2=%2226%22 y2=%2227%22 stroke=%22white%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 opacity=%220.6%22/%3E%3Cpolyline points=%2221,31 23,33 28,28%22 stroke=%22white%22 stroke-width=%221.8%22 fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 opacity=%220.8%22/%3E%3C/svg%3E");
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 40%, #2d68ea 100%);
    padding: 1.5rem 0 2rem;
    color: white;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

/* Search Box */
.search-container {
    max-width: 560px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 14px;
    padding: 0.35rem 0.35rem 0.35rem 1.2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.3s;
}

.search-box:focus-within {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--tv-accent);
}

.search-icon {
    color: var(--tv-text-muted);
    font-size: 22px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--tv-text);
    background: transparent;
    padding: 0.6rem 0.5rem;
    min-width: 0;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-input:disabled {
    opacity: 0.6;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, var(--tv-accent), var(--tv-cyan));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-btn .material-symbols-outlined {
    font-size: 20px;
}

/* Search Mode Toggle */
.search-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.25rem;
    max-width: 360px;
    margin: 0 auto 0.6rem;
}

.search-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.search-mode-btn .material-symbols-outlined {
    font-size: 18px;
}

.search-mode-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}

.search-mode-btn.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-weight: 600;
}

/* Search Fields (Year / Make / Model) */
.search-fields {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border-radius: 14px;
    padding: 0.35rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.3s;
}

.search-fields:focus-within {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--tv-accent);
}

.search-field-year {
    max-width: 120px;
    text-align: center;
    padding-left: 0.75rem !important;
    padding-right: 0.5rem !important;
}

.search-field-make {
    flex: 1.2;
}

.search-field-model {
    flex: 1;
}

/* Select dropdown styling within search-fields */
.search-fields select.search-input {
    appearance: auto;
    cursor: pointer;
    background: transparent;
    color: #1e293b;
}

.search-fields select.search-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #94a3b8;
}

.search-fields select.search-input option {
    background: white;
    color: #1e293b;
}

/* Type search loading indicator */
.type-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    padding: 0.5rem 0 0;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Type Analysis Badge */
.type-analysis-badge {
    background: linear-gradient(135deg, var(--tv-accent), var(--tv-cyan));
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Top-Level Mode Toggle (Aircraft / Business) */
.top-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: 480px;
    margin: 0 auto 0.75rem;
}

.top-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.top-mode-btn .material-symbols-outlined {
    font-size: 20px;
}

.top-mode-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

.top-mode-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--tv-accent);
    color: white;
    font-weight: 600;
}

/* Business Analysis Badge */
.business-analysis-badge {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Airport Analysis Badges */
.airport-analysis-badge {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cached-badge {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.kb-grounded-badge {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.airport-code-badge {
    background: linear-gradient(135deg, #2d68ea, #1a4fc0);
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-family: 'Inter', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

/* Airport Profile Section */
.airport-profile-section {
    background: var(--tv-card);
    border: 1px solid var(--tv-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.airport-profile-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    color: #06b6d4;
}

.airport-profile-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--tv-text);
}

.airport-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 3rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .airport-profile-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .airport-search-results {
        border-radius: 10px;
    }

    .airport-result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

.airport-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
}

.airport-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tv-text-muted);
}

.airport-detail-value {
    font-size: 0.95rem;
    color: var(--tv-text);
    line-height: 1.4;
}

.airport-detail-multiline {
    white-space: pre-line;
}

.airport-resource-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--tv-border);
}

.airport-resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--tv-border);
    color: var(--tv-accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.airport-resource-link:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--tv-accent);
    color: var(--tv-accent);
}

.airport-resource-link .material-symbols-outlined {
    font-size: 1rem;
}

/* Business Profile Section */
.business-profile-section {
    background: var(--tv-card);
    border: 1px solid var(--tv-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.business-profile-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    color: #7c3aed;
}

.business-profile-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--tv-text);
}

.business-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 3rem;
}

.business-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
}

.business-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tv-text-muted);
}

.business-detail-value {
    font-size: 0.95rem;
    color: var(--tv-text);
    line-height: 1.4;
}

.business-detail-value a {
    color: var(--tv-accent);
    text-decoration: none;
    word-break: break-all;
}

.business-detail-value a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .business-profile-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Airport Name Search Results */
.airport-search-results {
    margin-top: 0.75rem;
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.airport-search-results-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.airport-search-results-header .material-symbols-outlined {
    font-size: 18px;
}

.airport-search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.airport-search-result-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    font-family: 'Inter', sans-serif;
}

.airport-search-result-item:last-child {
    border-bottom: none;
}

.airport-search-result-item:hover {
    background: #f0f9ff;
}

.airport-search-result-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.airport-result-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.airport-result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
}

.airport-result-lid {
    background: linear-gradient(135deg, #2d68ea, #1a4fc0);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: 'Inter', monospace;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

.airport-result-icao {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-family: 'Inter', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.airport-search-no-results {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fefce8;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #854d0e;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.airport-search-no-results .material-symbols-outlined {
    font-size: 20px;
    color: #ca8a04;
}

/* Analysis Loading Indicator */
.analysis-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    animation: fadeIn 0.2s ease-out;
}

.analysis-loading-dialog {
    max-width: 460px;
    width: 90%;
    padding: 2.5rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(13, 59, 102, 0.25);
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.analysis-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
}

.analysis-loading-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.analysis-loading-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.analysis-loading-progress {
    width: 100%;
    max-width: 280px;
    height: 4px;
    margin: 0 auto 1rem;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.analysis-loading-progress-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 2px;
    animation: indeterminate 1.8s ease-in-out infinite;
}

@keyframes indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.analysis-loading-steps {
    max-width: 360px;
    margin: 0 auto 1.25rem;
    text-align: left;
}

.analysis-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    color: #94a3b8;
    transition: color 0.3s;
}

.analysis-step.active {
    color: #1e293b;
    font-weight: 500;
}

.analysis-step.completed {
    color: #16a34a;
}

.analysis-step-icon {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-step-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.analysis-step-label {
    line-height: 1.3;
}

.analysis-loading-note {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* Agent Failed / Retry */
.agent-failed-message {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #64748b;
}
.agent-failed-message > .material-symbols-outlined {
    font-size: 2rem;
    color: #f59e0b;
    display: block;
    margin-bottom: 0.75rem;
}
.agent-failed-message p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.agent-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.agent-retry-btn:hover { background: #2563eb; }
.agent-retry-btn .material-symbols-outlined { font-size: 1.125rem; }

.agent-retry-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}
.agent-retry-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Business Name Search Results */
.business-search-results {
    margin-top: 0.75rem;
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.business-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.business-search-results-header .material-symbols-outlined {
    font-size: 18px;
}

.business-search-location-note {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.78rem;
    color: #7c3aed;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.try-another-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
}

.try-another-btn:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #94a3b8;
}

.business-search-results-list {
    max-height: 600px;
    overflow-y: auto;
}

.business-search-group {
    border-bottom: 1px solid #f1f5f9;
}

.business-search-group:last-child {
    border-bottom: none;
}

.business-search-group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

.business-search-group-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    color: white;
}

.business-search-group-badge.rank-1 {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.business-search-group-badge.rank-2 {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.business-search-group-badge.rank-3 {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.business-search-group-count {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

.business-search-result-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    font-family: 'Inter', sans-serif;
}

.business-search-group .business-search-result-item:last-child {
    border-bottom: none;
}

.business-search-result-item:hover {
    background: #f0f9ff;
}

.business-search-result-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.business-result-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.business-result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.business-result-location {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.business-result-url {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-family: 'Inter', monospace;
    font-size: 0.78rem;
    color: #3b82f6;
}

.business-result-description {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    margin-top: 0.15rem;
}

.business-search-no-results {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fefce8;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #854d0e;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.business-search-no-results .material-symbols-outlined {
    font-size: 20px;
    color: #ca8a04;
}

/* Owner Name Search Results */
.owner-search-results {
    margin-top: 0.75rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.owner-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #475569;
}

.owner-search-results-list {
    max-height: 600px;
    overflow-y: auto;
}

.owner-search-group {
    border-bottom: 1px solid #e2e8f0;
}

.owner-search-group:last-child {
    border-bottom: none;
}

.owner-search-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.owner-search-group-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.owner-search-group-badge.rank-1 {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.owner-search-group-badge.rank-2 {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.owner-search-group-badge.rank-3 {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.owner-search-group-count {
    font-size: 0.78rem;
    color: #94a3b8;
}

.owner-search-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.owner-search-result-item:hover {
    background: #f0f9ff;
}

.owner-search-result-item:last-child {
    border-bottom: none;
}

.owner-result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.owner-result-nnumber {
    font-family: 'Inter', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0d3b66;
    background: rgba(59, 130, 246, 0.08);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.owner-result-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

.owner-result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
    padding-left: 0;
}

.owner-result-location {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.owner-result-aircraft {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: #0891b2;
}

.owner-search-no-results {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fefce8;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #854d0e;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.owner-search-no-results .material-symbols-outlined {
    font-size: 20px;
    color: #ca8a04;
}

/* Accident/Incident History Section */
.accident-history-section {
    background: var(--tv-card);
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-top: 1.5rem;
}

.accident-history-empty {
    border-left-color: #16a34a;
    border-color: #bbf7d0;
}

.accident-history-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    color: #dc2626;
}

.accident-history-empty .accident-history-header {
    color: #16a34a;
}

.accident-history-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--tv-text);
}

.accident-count-badge {
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid #fecaca;
    margin-left: auto;
}

.accident-empty-message {
    color: var(--tv-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.accident-record {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.accident-record:last-child {
    margin-bottom: 0;
}

.accident-record-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tv-text);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.accident-record-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.accident-event-type {
    font-weight: 600;
    font-size: 0.75rem;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fee2e2;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.accident-event-date {
    font-size: 0.85rem;
    color: var(--tv-text-muted);
}

.accident-severity {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
}

.accident-severity-fatal { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.accident-severity-serious { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.accident-severity-minor { background: #fefce8; color: #a16207; border: 1px solid #fde047; }
.accident-severity-none { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.accident-severity-unknown { background: #f8fafc; color: #64748b; border: 1px solid #cbd5e1; }

.accident-status-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--tv-text-muted);
    background: #f1f5f9;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-left: auto;
}

.accident-damage {
    font-size: 0.75rem;
    color: var(--tv-text-muted);
    font-style: italic;
}

.accident-record-details {
    margin-bottom: 0.75rem;
}

.accident-detail-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--tv-text-muted);
    margin-bottom: 0.3rem;
}

.accident-detail-row .material-symbols-outlined {
    color: #94a3b8;
}

.accident-narrative {
    font-size: 0.85rem;
    color: var(--tv-text);
    line-height: 1.5;
    margin-top: 0.5rem;
}

.accident-probable-cause {
    font-size: 0.82rem;
    color: var(--tv-text-muted);
    margin-top: 0.4rem;
    padding-left: 0.5rem;
    border-left: 2px solid #fca5a5;
}

.accident-record-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #fde8e8;
}

.accident-ntsb-id {
    font-size: 0.75rem;
    color: #64748b;
    font-family: monospace;
}

.accident-record-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--tv-accent);
    text-decoration: none;
    margin-left: auto;
}

.accident-record-link:hover {
    text-decoration: underline;
    color: #2563eb;
}

@media (max-width: 768px) {
    .accident-history-section {
        padding: 1rem 1.25rem;
    }
    .accident-record-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .accident-status-badge {
        margin-left: 0;
    }
}

/* Usage Indicator */
.usage-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
}

/* When ChatLayout is nested inside MainLayout, constrain to viewport and hide footer */
.app-layout:has(.chat-layout) {
    height: 100vh;
    overflow: hidden;
}
.app-layout:has(.chat-layout) > .app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.app-layout:has(.chat-layout) > .app-footer {
    display: none;
}

/* Suppress focus outline on brand area (Blazor sets focus on first render) */
.app-header h1,
.app-header .brand-logo,
.app-header .brand-subtitle {
    outline: none;
}

/* Header Nav Links - override Bootstrap's default link colors */
.app-header a.nav-link-custom,
.app-header a.nav-link-custom:visited,
.app-header a.nav-link-custom.active {
    color: #ffffff;
}

.app-header a.nav-link-custom:hover,
.app-header a.nav-link-custom:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

.app-header .nav-user-name {
    color: rgba(255, 255, 255, 0.9);
}

.app-header .nav-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Admin nav link badge */
.app-header a.nav-link-custom.nav-admin {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ffffff;
}

.app-header a.nav-link-custom.nav-admin:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
}

/* Admin sidebar nav links - override Bootstrap's default link colors */
.admin-sidebar a.admin-nav-link,
.admin-sidebar a.admin-nav-link:visited {
    color: #ffffff;
    text-decoration: none;
}

.admin-sidebar a.admin-nav-link:hover,
.admin-sidebar a.admin-nav-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar a.admin-nav-link.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.3);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--tv-card);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--tv-border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tv-text);
    margin-bottom: 0.25rem;
}

.auth-header p {
    font-size: 0.9rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.auth-card .form-label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--tv-text);
}

.auth-card .form-control {
    border-radius: 8px;
    border: 1px solid var(--tv-border);
    padding: 0.6rem 0.85rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card .form-control:focus {
    border-color: var(--tv-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-card .btn-primary {
    background: linear-gradient(135deg, var(--tv-accent), #2563eb);
    border: none;
    border-radius: 10px;
    padding: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.auth-card .btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tv-border);
}

.auth-footer p {
    font-size: 0.88rem;
    color: var(--tv-text-muted);
    margin: 0;
}

.auth-footer a {
    color: var(--tv-accent);
    font-weight: 500;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Terms of Use section */
.terms-section {
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    padding: 1.25rem;
    background: rgba(59, 130, 246, 0.02);
}

.terms-content {
    max-height: 220px;
    overflow-y: auto;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #475569;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--tv-border);
    border-radius: 8px;
}

.terms-content p {
    margin-bottom: 0.5rem;
}

.terms-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.terms-content ol li {
    margin-bottom: 0.5rem;
}

.terms-acceptance .form-check-label {
    font-size: 0.82rem;
    line-height: 1.4;
    color: #334155;
}

.terms-signature .form-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.signature-input {
    font-family: 'Dancing Script', 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    border-style: dashed !important;
}

.signature-input::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: normal;
}

/* Validation messages */
.validation-message {
    color: #ef4444;
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

/* Results Container */
.results-container {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* Inline Analysis Notes (collapsible on search screen) */
.analysis-notes-inline {
    margin-top: 0.75rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.analysis-notes-inline details {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 10px;
    overflow: hidden;
}

.analysis-notes-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    list-style: none;
}

.analysis-notes-toggle::-webkit-details-marker {
    display: none;
}

.analysis-notes-toggle::before {
    content: '▸';
    font-size: 0.75rem;
    transition: transform 0.2s;
}

details[open] > .analysis-notes-toggle::before {
    transform: rotate(90deg);
}

.analysis-notes-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.analysis-notes-textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    line-height: 1.5;
    box-sizing: border-box;
}

.analysis-notes-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

.analysis-notes-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.analysis-notes-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preview-back-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.type-badge {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

@media (max-width: 768px) {
    .preview-card-body {
        padding: 1rem;
    }

    .preview-actions {
        flex-direction: column;
    }

    .preview-actions .search-btn,
    .preview-actions .preview-back-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Aircraft Header Card */
.aircraft-header-card {
    background: var(--tv-card);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--tv-border);
}

.n-number-badge {
    background: linear-gradient(135deg, var(--tv-navy), var(--tv-blue));
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.amin-code-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--tv-accent);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-family: 'Inter', monospace;
    font-size: 0.82rem;
    font-weight: 600;
}

.aircraft-name {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tv-text);
    margin: 0.5rem 0 0.75rem;
    letter-spacing: -0.02em;
}

.aircraft-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.aircraft-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--tv-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.aircraft-meta .material-symbols-outlined {
    font-size: 18px;
    color: var(--tv-accent);
}

.analysis-timestamp {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    color: var(--tv-text-muted);
    font-size: 0.8rem;
}

.analysis-timestamp .material-symbols-outlined {
    font-size: 16px;
}

.ai-disclaimer {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(234, 179, 8, 0.08);
    color: #a16207;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    font-style: italic;
}

.ai-disclaimer .material-symbols-outlined {
    font-size: 15px;
}

/* Tab Navigation */
.analysis-tabs {
    border-bottom: 2px solid var(--tv-border);
    gap: 0;
}

.analysis-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--tv-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
}

.analysis-tabs .nav-link .material-symbols-outlined {
    font-size: 20px;
}

.analysis-tabs .nav-link:hover {
    color: var(--tv-text);
    background: rgba(59, 130, 246, 0.04);
}

.analysis-tabs .nav-link.active {
    color: var(--tv-accent);
    border-bottom-color: var(--tv-accent);
    background: none;
}

/* Tab Content */
.analysis-content {
    padding: 1.5rem 0;
}

/* Analysis Mode Toggle */
.analysis-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: center;
}
.mode-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.mode-toggle-btn.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #fff;
}
.mode-toggle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Analysis Mode Badge */
.analysis-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.analysis-mode-badge.mode-standard {
    background: rgba(234, 179, 8, 0.12);
    color: #ca8a04;
}
.analysis-mode-badge.mode-deep {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

/* Upgrade Prompt Card */
.upgrade-prompt-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(59, 130, 246, 0.04));
    border: 1px dashed #c4b5fd;
    border-radius: 14px;
    padding: 1.25rem;
}
.upgrade-prompt-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.upgrade-prompt-content > div {
    flex: 1;
    min-width: 200px;
}

/* Analysis Cards */
.analysis-content .row {
    align-items: start;
}

.analysis-card {
    background: var(--tv-card);
    border-radius: 14px;
    border: 1px solid var(--tv-border);
    border-left: 3px solid var(--tv-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.analysis-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.analysis-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    background: rgba(59, 130, 246, 0.04);
    border-bottom: 1px solid var(--tv-border);
}

.analysis-card-header .material-symbols-outlined {
    font-size: 22px;
    color: var(--tv-accent);
}

.analysis-card-header h5 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--tv-text);
}

.analysis-card-body {
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #334155;
}

/* Markdown content within analysis cards */
.analysis-card-body h1,
.analysis-card-body h2,
.analysis-card-body h3,
.analysis-card-body h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--tv-text);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.analysis-card-body h1 { font-size: 1.1rem; }
.analysis-card-body h2 { font-size: 1.05rem; }
.analysis-card-body h3 { font-size: 1rem; }
.analysis-card-body h4 { font-size: 0.95rem; }
.analysis-card-body h1:first-child,
.analysis-card-body h2:first-child,
.analysis-card-body h3:first-child,
.analysis-card-body h4:first-child { margin-top: 0; }

.analysis-card-body p {
    margin-bottom: 0.75rem;
}
.analysis-card-body p:last-child { margin-bottom: 0; }

.analysis-card-body ul,
.analysis-card-body ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}
.analysis-card-body li {
    margin-bottom: 0.35rem;
}

.analysis-card-body strong {
    font-weight: 600;
    color: var(--tv-text);
}

.analysis-card-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}
.analysis-card-body th,
.analysis-card-body td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}
.analysis-card-body th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--tv-text);
}

.analysis-card-body blockquote {
    border-left: 3px solid #3b82f6;
    margin: 0.75rem 0;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    color: #475569;
}

.analysis-card-body hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1rem 0;
}

/* Accent variations — header background, icon color, and left border */
.accent-red .analysis-card-header { background: rgba(239, 68, 68, 0.06); }
.accent-red .analysis-card-header .material-symbols-outlined { color: #dc2626; }
.analysis-card.accent-red { border-left-color: #dc2626; }

.accent-orange .analysis-card-header { background: rgba(249, 115, 22, 0.06); }
.accent-orange .analysis-card-header .material-symbols-outlined { color: #ea580c; }
.analysis-card.accent-orange { border-left-color: #ea580c; }

.accent-green .analysis-card-header { background: rgba(34, 197, 94, 0.06); }
.accent-green .analysis-card-header .material-symbols-outlined { color: #16a34a; }
.analysis-card.accent-green { border-left-color: #16a34a; }

.accent-blue .analysis-card-header { background: rgba(59, 130, 246, 0.06); }
.accent-blue .analysis-card-header .material-symbols-outlined { color: #2563eb; }
.analysis-card.accent-blue { border-left-color: #2563eb; }

.accent-purple .analysis-card-header { background: rgba(139, 92, 246, 0.06); }
.accent-purple .analysis-card-header .material-symbols-outlined { color: #7c3aed; }
.analysis-card.accent-purple { border-left-color: #7c3aed; }

.accent-teal .analysis-card-header { background: rgba(6, 182, 212, 0.06); }
.accent-teal .analysis-card-header .material-symbols-outlined { color: #0891b2; }
.analysis-card.accent-teal { border-left-color: #0891b2; }

.accent-sky .analysis-card-header { background: rgba(14, 165, 233, 0.06); }
.accent-sky .analysis-card-header .material-symbols-outlined { color: #0284c7; }
.analysis-card.accent-sky { border-left-color: #0284c7; }

/* Detail Cards (FAA Details tab) */
.detail-card {
    background: var(--tv-card);
    border-radius: 14px;
    border: 1px solid var(--tv-border);
    padding: 1.25rem 1.5rem;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.detail-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tv-text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--tv-border);
}

.detail-card-title .material-symbols-outlined {
    font-size: 20px;
    color: var(--tv-accent);
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}

.detail-list dt {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--tv-text-muted);
    white-space: nowrap;
}

.detail-list dd {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--tv-text);
    margin: 0;
    word-break: break-word;
}

/* Alert styling */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
}

.alert .material-symbols-outlined {
    font-size: 22px;
}

/* Bootstrap overrides */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--tv-accent);
}

/* Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Blazor error UI */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Print Results Button */
.print-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--tv-border);
    border-radius: 8px;
    background: var(--tv-card);
    color: var(--tv-text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.print-results-btn:hover {
    background: rgba(59, 130, 246, 0.06);
    border-color: var(--tv-accent);
    color: var(--tv-accent);
}

.print-results-btn .material-symbols-outlined {
    font-size: 18px;
}

.chat-about-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 8px;
    background: rgba(6, 182, 212, 0.08);
    color: #06b6d4;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.chat-about-btn:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: #06b6d4;
}
.chat-about-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.4rem;
    }

    .hero-section {
        padding: 1.25rem 0 1.5rem;
    }

    .search-box {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .search-icon {
        display: none;
    }

    .search-input {
        width: 100%;
        text-align: center;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

    .search-fields {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .search-field-year {
        max-width: 100%;
        width: 100%;
    }

    .search-field-make,
    .search-field-model {
        width: 100%;
    }

    .search-fields select.search-input {
        width: 100%;
    }

    .search-mode-toggle {
        max-width: 100%;
    }

    .top-mode-toggle {
        max-width: 100%;
    }

    .aircraft-header-card {
        padding: 1.25rem;
    }

    .aircraft-name {
        font-size: 1.25rem;
    }

    .aircraft-meta {
        gap: 0.75rem;
    }

    .analysis-tabs .nav-link {
        padding: 0.75rem 0.75rem;
        font-size: 0.82rem;
    }

    .analysis-tabs .nav-link .material-symbols-outlined {
        font-size: 18px;
    }

    .analysis-timestamp {
        justify-content: flex-start;
    }
}

/* ============================================================================
   Chat UI Styles
   ============================================================================ */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Route map side panel (Phase 3) — docked split-pane + fullscreen + launch card ── */
.chat-shell {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0;
    height: 100vh; /* mirror the old .chat-container sizing exactly (proven), not flex-nesting-dependent */
    overflow: hidden;
}
.chat-shell > .chat-container {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
}
.route-panel-splitter {
    flex: 0 0 6px;
    cursor: col-resize;
    background: var(--tv-border, #e4e7ee);
    touch-action: none;
}
.route-panel-splitter:hover,
body.route-panel-resizing .route-panel-splitter { background: #2d68ea; }
body.route-panel-resizing { cursor: col-resize; user-select: none; }
body.route-panel-resizing .route-panel-map,
body.route-panel-resizing .leaflet-container { pointer-events: none; }

.route-panel {
    flex: 0 0 auto;
    width: 33vw; /* default ≈ one-third of the viewport; still drag-resizable + persisted */
    min-width: 320px;
    max-width: 60vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid var(--tv-border, #e4e7ee);
    overflow: hidden;
}
.route-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem 0.5rem 0.85rem;
    min-height: 48px;
    background: #f6f8fc;
    border-bottom: 1px solid var(--tv-border, #e4e7ee);
}
.route-panel-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: #12203b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.route-switcher {
    flex: 1;
    min-width: 0;
    max-width: 280px;
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--tv-border, #e4e7ee);
    border-radius: 6px;
    background: #fff;
    color: #12203b;
}
.route-panel-actions { display: flex; gap: 0.25rem; margin-left: auto; }
.route-panel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #5b6473;
    cursor: pointer;
}
.route-panel-btn:hover { background: rgba(45, 104, 234, 0.12); color: #2d68ea; }
.route-panel-btn .material-symbols-outlined { font-size: 20px; }
.route-panel-map { flex: 1 1 0; min-height: 0; }

/* Fullscreen route dialog */
.route-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 20, 40, 0.55);
    display: flex;
}
.route-fullscreen-dialog {
    margin: auto;
    width: 96vw;
    height: 94vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}
.route-fullscreen-map { flex: 1 1 0; min-height: 0; }

/* "Show route" launch card (replaces the inline map in the message bubble) */
.route-launch-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 520px;
    margin-top: 0.6rem;
    padding: 0.65rem 0.85rem;
    background: #f6f8fc;
    border: 1px solid var(--tv-border, #e4e7ee);
    border-left: 3px solid #2d68ea;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}
.route-launch-card:hover { background: #eef4ff; box-shadow: 0 2px 12px rgba(45, 104, 234, 0.15); }
.route-launch-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(45, 104, 234, 0.12);
    color: #2d68ea;
}
.route-launch-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.route-launch-title {
    font-weight: 700;
    color: #12203b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.route-launch-sub { font-size: 0.8rem; color: #5b6473; }
.route-launch-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    color: #2d68ea;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}
.route-launch-cta .material-symbols-outlined { font-size: 18px; }

/* Mobile (<768px): OpenRoute goes straight to fullscreen (RoutePanel.isNarrowViewport probe), so the
   docked panel normally never renders here. This cap is the fallback for a desktop-opened panel
   surviving a window shrink. */
@media (max-width: 768px) {
    .route-panel { max-width: 100vw; }
}

/* Chat top bar */
.chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--tv-border);
    min-height: 56px;
}

.chat-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.chat-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}

.chat-topbar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-topbar-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--tv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-topbar-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}

.chat-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-usage-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--tv-surface);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--tv-text-muted);
    font-weight: 500;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

/* Welcome screen */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 2rem;
    color: var(--tv-text-muted);
}

.chat-welcome-icon {
    font-size: 3rem;
    color: var(--tv-accent);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.chat-welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.chat-welcome h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--tv-text);
    margin-bottom: 0.5rem;
}

.chat-welcome p {
    max-width: 500px;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.chat-welcome-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 600px;
}

.chat-followup-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-suggestion {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--tv-border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--tv-text);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.chat-suggestion:hover {
    border-color: var(--tv-accent);
    background: rgba(59, 130, 246, 0.04);
}

/* Message bubbles */
.chat-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 85%;
}

.chat-message-user {
    align-self: flex-end;
    flex-direction: row;
}

.chat-message-assistant {
    align-self: flex-start;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tv-accent), var(--tv-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message-avatar .material-symbols-outlined {
    font-size: 1rem;
    color: white;
}

.avia-avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
}

.avatar-user {
    background: linear-gradient(135deg, #64748b, #475569);
}

.chat-message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.9rem;
}

.bubble-user {
    background: linear-gradient(135deg, var(--tv-accent), #2563eb);
    color: white;
    border-bottom-right-radius: 4px;
}

.bubble-user p {
    margin: 0;
}

.bubble-assistant {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 100%);
    color: var(--tv-text);
    border: 1px solid rgba(59, 130, 246, 0.08);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.06);
    position: relative;
}

/* Markdown content in assistant bubbles */
.bubble-assistant h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
    color: var(--tv-text);
}

.bubble-assistant h3:first-child {
    margin-top: 0;
}

.bubble-assistant p {
    margin: 0 0 0.5rem;
}

.bubble-assistant p:last-child {
    margin-bottom: 0;
}

.bubble-assistant ul, .bubble-assistant ol {
    margin: 0.25rem 0 0.5rem;
    padding-left: 1.25rem;
}

.bubble-assistant li {
    margin-bottom: 0.2rem;
}

.bubble-assistant strong {
    font-weight: 600;
    color: var(--tv-text);
}

.bubble-assistant code {
    background: var(--tv-surface);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* Per-message PDF download button */
.chat-msg-download-bar {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
}

.chat-msg-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px solid #cbd5e1;
    color: #64748b;
    cursor: pointer;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.chat-msg-download-btn .material-symbols-outlined {
    font-size: 1rem;
}

.chat-msg-download-btn:hover {
    color: var(--tv-accent);
    background: rgba(45, 104, 234, 0.06);
    border-color: var(--tv-accent);
}

/* Tool activity chips */
.chat-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: rgba(59, 130, 246, 0.08);
    color: var(--tv-accent);
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.chat-tool-active {
    animation: toolPulse 1.5s ease-in-out infinite;
}

@keyframes toolPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Flight route map in chat bubbles */
.flight-route-map-container {
    height: 500px;
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tv-border);
    position: relative;
    z-index: 0;
}

.flight-route-map-container .leaflet-container {
    height: 100%;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.flight-route-map-container .leaflet-control-layers {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.flight-route-map-container .leaflet-control-layers-list label {
    margin-bottom: 2px;
}

.flight-route-map-container .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.flight-route-map-container .leaflet-popup-content {
    margin: 8px 12px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.flight-route-map-container .leaflet-popup-content strong {
    color: var(--tv-accent);
}

.flight-route-marker {
    background: none !important;
    border: none !important;
}

/* Driving route map in chat bubbles */
.driving-route-map-container {
    height: 500px;
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tv-border);
    position: relative;
    z-index: 0;
}

.driving-route-map-container .leaflet-container {
    height: 100%;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.driving-route-map-container .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.driving-route-map-container .leaflet-popup-content {
    margin: 8px 12px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.driving-route-marker {
    background: none !important;
    border: none !important;
}

.driving-route-info {
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', sans-serif;
}

.flight-route-map-pending {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .flight-route-map-container,
    .driving-route-map-container {
        height: 440px;
    }
}

/* Streaming cursor */
.chat-cursor {
    animation: blink 0.8s step-end infinite;
    color: var(--tv-accent);
    font-weight: 300;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Avia thinking indicator */
.avia-thinking {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0;
}
.avia-thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    animation: aviaBounce 1.4s ease-in-out infinite;
}
.avia-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.avia-thinking-dot:nth-child(3) { animation-delay: 0.4s; }
.avia-thinking-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: 0.25rem;
    font-style: italic;
}
@keyframes aviaBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.chat-input-area {
    border-top: 1px solid var(--tv-border);
    background: white;
    padding: 0.75rem 1.5rem 0.5rem;
}

.chat-limit-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.chat-limit-alert a {
    color: var(--tv-accent);
    font-weight: 600;
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--tv-surface);
    border-radius: 14px;
    padding: 0.5rem;
    border: 1px solid var(--tv-border);
    transition: border-color 0.2s;
}

.chat-input-bar:focus-within {
    border-color: var(--tv-accent);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    max-height: 120px;
    color: var(--tv-text);
}

.chat-input::placeholder {
    color: var(--tv-text-muted);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--tv-accent), var(--tv-cyan));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
}

.chat-send-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn .material-symbols-outlined {
    font-size: 1.2rem;
}

/* Attach button */
.chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--tv-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}

.chat-attach-btn:hover:not(:disabled) {
    color: var(--tv-accent);
    background: rgba(45, 104, 234, 0.08);
}

.chat-attach-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-attach-btn .material-symbols-outlined {
    font-size: 1.3rem;
}

/* Attachment preview strip */
.chat-attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0;
}

.attachment-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    padding: 0.3rem 0.5rem;
    max-width: 200px;
}

.attachment-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.attachment-file-icon {
    font-size: 1.4rem;
    color: var(--tv-text-muted);
    flex-shrink: 0;
}

.attachment-name {
    font-size: 0.78rem;
    color: var(--tv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.attachment-size {
    font-size: 0.7rem;
    color: var(--tv-text-muted);
    flex-shrink: 0;
}

.attachment-remove {
    background: none;
    border: none;
    color: var(--tv-text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.attachment-remove:hover {
    color: #ef4444;
}

.attachment-remove .material-symbols-outlined {
    font-size: 1rem;
}

/* Attachment indicators in message history */
.chat-msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.chat-msg-attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.chat-input-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    color: var(--tv-text-muted);
}

.chat-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem 0.15rem;
    font-size: 0.65rem;
    color: #94a3b8;
    line-height: 1.35;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 0.15rem;
}

/* Chat responsive */
@media (max-width: 768px) {
    .chat-messages {
        padding: 1rem;
    }

    .chat-message {
        max-width: 95%;
    }

    .chat-input-area {
        padding: 0.5rem 1rem;
    }

    .chat-welcome-suggestions {
        flex-direction: column;
    }
}

/* ============================================================
   AviAMS Sidebar Navigation (global — scoped CSS doesn't reach NavLink)
   ============================================================ */

.ams-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s;
}

.ams-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
}

.ams-nav-link.active {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.25);
}

.ams-nav-link .material-symbols-outlined {
    font-size: 18px;
    opacity: 0.85;
}

.ams-nav-link.active .material-symbols-outlined {
    opacity: 1;
}

.ams-nav-section-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.6rem 0.2rem;
}

.ams-sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.25rem 0.75rem;
}
