/* ============================================================
   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 */
/* The sub-mode segmented control, shared by all five pills. It HUGS its buttons rather than
   sitting at a fixed cap: the groups range from 2 short labels (Airport Code / Airport Name) to
   4 (N# / Model / Owner / Photos) to 3 long ones (Single Policy / Policy Check / Compare
   Policies), and the buttons carry no `min-width: 0`, so a cap narrower than the content made
   them overflow the pill background instead of shrinking. `max-width: 100%` keeps it inside
   .search-container (560px) and `flex-wrap` is the narrow-viewport fallback — wrap to a second
   row, never spill. Any new sub-mode or a renamed label is then self-fitting. */
.search-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.25rem;
    width: fit-content;
    max-width: 100%;
    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;
    /* Content-sized, NOT flex:1. flex:1 is flex-basis:0 + grow, which is what forced every group
       to the pill's full width and left long labels nothing to grow into. Labels here vary from
       "N#" to "Compare Policies", so hugging each one is both what fits and what reads right. */
    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) */
/* NOTE the deliberate difference from .search-mode-toggle below, which was widened to hug its
   buttons. This row's content IS wider than the 480px box (7 pills ≈ 994px), but unlike the
   sub-mode control this container draws NO background — only the buttons have borders — and a
   nowrap overflow under `justify-content: center` spills symmetrically, so it renders as an
   ordinary centered row. Switching it to fit-content + wrap makes it a visible TWO-row bar
   inside its col-lg-8 (736px), which is worse, not better. Left as-is on purpose: the cap is
   doing no harm here precisely because there is nothing for the buttons to visibly escape. */
.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;

    /* MUST be set explicitly. The overlay is position:fixed but still a DOM DESCENDANT of
       .hero-section, which sets `color: white` — so on a white dialog any text without its own
       colour class rendered white-on-white and was invisible. The symptom was specific and
       confusing: the ACTIVE progress step (styled only `fw-semibold`) disappeared while the
       completed and pending steps showed, because those carry Bootstrap's `text-muted` grey — so
       each line appeared only once it finished. Setting the colour here fixes every panel that
       uses this overlay at once, rather than one span at a time. */
    color: #1f2937;
}

@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;
}

/* AviaIntel comparison / check panels — results break out of the 560px search column.
   The four panels (policy compare, policy check, quote check, quote compare) all share the
   .policy-compare-panel root and are mounted INSIDE .search-container, which is capped at
   560px. That cap is right for their INPUTS (they're search inputs like every other mode)
   but wrong for their RESULTS: a comparison grid is one column per policy plus a label
   column, so at 560px the grid clipped and the ranking cards wrapped to 2-3 words per line
   (2026-08 fix). Normal analysis results get the full .container width from
   .results-container; this gives the panel results the equivalent.

   margin-left:50% puts the block's left edge at the parent's horizontal centre, and
   translateX(-50%) pulls it back by half its own width — so it centres on the viewport
   (.search-container is margin:0 auto inside a centred column, so parent centre ==
   viewport centre). Scoped to .analysis-results ONLY: the panels' .analysis-loading-overlay
   is position:fixed and a SIBLING of this block, so the transform can't trap it.

   Targeted by the dedicated .policy-panel-results class, NOT by descent from
   .policy-compare-panel — the results block sits in its own @if and is a SIBLING of the
   panel div, not a child. A dedicated class also keeps this off Home.razor's own
   .analysis-results, which already gets full width from .results-container. */
.policy-panel-results {
    width: min(94vw, 1200px);
    margin-left: 50%;
    transform: translateX(-50%);
}

/* A rendered dossier / analysis quotes long URLs (EDGAR filing indexes, CourtListener dockets,
   OFAC entries) as bare links. An unbreakable URL forces the card body to scroll sideways and the
   citation runs off the right edge (reported 2026-09-04 on the ownership dossier) — let long
   words and links wrap inside the card instead. Tables keep their own horizontal scroll. */
.analysis-card-body { overflow-wrap: anywhere; }
.analysis-card-body a { overflow-wrap: anywhere; word-break: break-word; }

/* Below the md breakpoint the search column is already ~full width, so the breakout is a
   no-op — drop it rather than fight the mobile layout. The grid still scrolls horizontally
   inside .analysis-card-body (overflow-x:auto), which is the correct small-screen behaviour. */
@media (max-width: 767.98px) {
    .policy-panel-results {
        width: auto;
        margin-left: 0;
        transform: none;
    }
}

/* 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);
}

/* A solid, clearly-framed input well — sits inside the dark notes panel but reads
   unmistakably as a text-entry field (white background, dark text, defined border,
   focus ring) rather than blending into the hero. Shared by the submission, policy,
   and aircraft notes textareas. */
.analysis-notes-textarea {
    display: block;
    /* Explicit width (not auto) — a <textarea> with width:auto falls back to its
       intrinsic `cols` width (~20 chars) instead of filling. calc(100% - gutters)
       makes it span the panel by default while keeping a small symmetric inset. */
    width: calc(100% - 1.5rem);
    margin: 0.25rem 0.75rem 0.85rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(6, 182, 212, 0.6);
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    line-height: 1.5;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.analysis-notes-textarea:focus {
    outline: none;
    border-color: #06b6d4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.28);
}

.analysis-notes-textarea::placeholder {
    color: #94a3b8;
    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;
    gap: 0.5rem;
}

.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;
}

/* =====================================================================
   Submission & Policy document analysis (AviaIntel)
   ===================================================================== */

/* Upload panel inside the hero search container */
.document-upload-panel {
    max-width: 720px;
    margin: 0 auto;
}

.document-upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.25rem 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.document-upload-drop:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.document-upload-drop input[type="file"] {
    display: none;
}

.document-upload-hint {
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.4;
}

.document-upload-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: center;
}

.document-upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.5rem 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.8rem;
    max-width: 100%;
}

.document-chip-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-chip-size {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
}

.document-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    padding: 0;
}

.document-chip-remove:hover {
    background: rgba(255, 100, 100, 0.5);
}

.document-upload-error {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    color: #fecaca;
    font-size: 0.83rem;
    justify-content: center;
}

.document-analyze-btn {
    margin-top: 0.85rem;
    width: 100%;
    justify-content: center;
}

/* Header badge */
.submission-analysis-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #7c3aed, #2d68ea);
    color: #fff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.submission-partial-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.83rem;
}

/* Score panel */
.analysis-score-panel {
    border-radius: 14px;
    padding: 1rem 1.25rem;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.analysis-score-number {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.analysis-score-band {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-score-confidence {
    font-size: 0.76rem;
    opacity: 0.85;
    margin-top: 0.2rem;
}

.score-band-low      { background: linear-gradient(135deg, #16a34a, #15803d); }
.score-band-moderate { background: linear-gradient(135deg, #d97706, #b45309); }
.score-band-elevated { background: linear-gradient(135deg, #ea580c, #c2410c); }
.score-band-high     { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.score-band-severe   { background: linear-gradient(135deg, #991b1b, #7f1d1d); }
.score-band-unknown  { background: linear-gradient(135deg, #64748b, #475569); }

.score-dimensions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.score-dimension {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: default;
}

.score-dimension-name {
    color: #475569;
}

.score-dimension-value {
    font-weight: 700;
    color: #1e293b;
}

.score-summary-note {
    margin-top: 0.75rem;
    font-size: 0.86rem;
    color: #475569;
}

/* Submission profile grid */
.submission-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem 1.25rem;
}

.submission-profile-grid > div {
    display: flex;
    flex-direction: column;
}

.profile-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

/* Tables */
.submission-table {
    font-size: 0.86rem;
}

.submission-table th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: nowrap;
}

.verification-intro {
    font-size: 0.85rem;
    color: #475569;
}

/* Verification status chips */
.vstatus-chip {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.vstatus-verified     { background: #dcfce7; color: #15803d; }
.vstatus-discrepancy  { background: #fef3c7; color: #b45309; }
.vstatus-notfound     { background: #fee2e2; color: #b91c1c; }
.vstatus-unverifiable { background: #e2e8f0; color: #475569; }

.field-diffs {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.25rem;
}

.field-diff {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.field-diff.diff-match .material-symbols-outlined { color: #16a34a; }
.field-diff.diff-mismatch { color: #b45309; }
.field-diff.diff-mismatch .material-symbols-outlined { color: #dc2626; }

.verification-flag {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #b91c1c;
}

.verification-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    padding-left: 0.75rem;
    border-left: 3px solid #e2e8f0;
}

/* Cross-validation findings */
.findings-subhead {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.finding-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.45rem;
    font-size: 0.87rem;
    border: 1px solid #e2e8f0;
}

.finding-row .finding-icon { font-size: 1.15rem; margin-top: 0.05rem; }
.finding-row.finding-ok      { background: #f0fdf4; border-color: #bbf7d0; }
.finding-row.finding-ok      .finding-icon { color: #16a34a; }
.finding-row.finding-caution { background: #fffbeb; border-color: #fde68a; }
.finding-row.finding-caution .finding-icon { color: #d97706; }
.finding-row.finding-flag    { background: #fef2f2; border-color: #fecaca; }
.finding-row.finding-flag    .finding-icon { color: #dc2626; }

.finding-head {
    font-weight: 600;
    color: #1e293b;
}

.finding-caveat {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* Per-entity accordion */
.entity-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: #fff;
}

.entity-accordion summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    list-style: none;
}

.entity-accordion summary::-webkit-details-marker { display: none; }

.entity-accordion[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.entity-accordion-name {
    font-weight: 600;
    color: #1e293b;
}

.entity-accordion-body {
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
}

.entity-analyzed-chip,
.entity-skipped-chip,
.entity-failed-chip,
.entity-ntsb-chip {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.entity-analyzed-chip { background: #dbeafe; color: #1d4ed8; }
.entity-skipped-chip  { background: #e2e8f0; color: #475569; }
.entity-failed-chip   { background: #fee2e2; color: #b91c1c; }
.entity-ntsb-chip     { background: #fef3c7; color: #b45309; }

/* Policy analysis */
.policy-analysis-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #0d9488, #2d68ea);
    color: #fff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.policy-list-details {
    margin-top: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    background: #f8fafc;
}

.policy-list-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.86rem;
    color: #334155;
}

.policy-list {
    margin: 0.5rem 0 0.25rem;
    padding-left: 1.25rem;
    font-size: 0.85rem;
}

.policy-list li {
    margin-bottom: 0.25rem;
}

.document-history-link {
    text-align: center;
    margin-top: 0.6rem;
}

.document-history-link a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.82rem;
    text-decoration: none;
}

.document-history-link a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Per-pill analysis history panel (Home hero) */
.pill-history-bar {
    display: flex;
    justify-content: center;
    margin: 0.35rem 0 0.75rem;
}

.pill-history-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.pill-history-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.pill-history-panel {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0.75rem;
    max-width: 620px;
    margin: 0 auto 1rem;
    text-align: left;
}

.pill-history-filter {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.42rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.6rem;
}

.pill-history-filter::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.pill-history-filter:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.45);
}

.pill-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.pill-history-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pill-history-item:last-child {
    border-bottom: none;
}

.pill-history-entry {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    padding: 0.55rem 0.4rem;
    border-radius: 8px;
}

.pill-history-entry:hover {
    background: rgba(255, 255, 255, 0.08);
}

.pill-history-title {
    color: #fff;
    font-size: 0.86rem;
    line-height: 1.35;
}

.pill-history-meta {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pill-history-badge {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
}

.pill-history-badge-deep {
    background: rgba(127, 119, 221, 0.3);
    color: #cecbf6;
}

.pill-history-badge-partial {
    background: rgba(239, 159, 39, 0.25);
    color: #fac775;
}

.pill-history-delete {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    line-height: 1;
}

.pill-history-delete:hover {
    color: #f09595;
    background: rgba(226, 75, 74, 0.15);
}

.pill-history-empty {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.84rem;
    text-align: center;
    padding: 0.9rem 0;
}

/* Document analysis history page */
.history-kind-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
}

.history-kind-submission { background: #ede9fe; color: #6d28d9; }
.history-kind-policy     { background: #ccfbf1; color: #0f766e; }
.history-kind-aircraft   { background: #dbeafe; color: #1d4ed8; }
.history-kind-airport    { background: #cffafe; color: #0e7490; }
.history-kind-business   { background: #fce7f3; color: #be185d; }

.history-score-chip {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}

/* Email drag-and-drop ingestion (Submission/Policy upload panel) */
.document-upload-panel.drop-active .document-upload-drop {
    border-color: #22d3ee;
    background: rgba(34, 211, 238, 0.12);
}

.document-upload-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    justify-content: center;
    margin-top: 0.6rem;
    color: #bfdbfe;
    font-size: 0.83rem;
}

.email-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.25);
    color: #a5f3fc;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: default;
}

.email-skipped-list {
    margin-top: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    text-align: left;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.email-skipped-head {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.25rem;
}

.email-skipped-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.15rem;
}

.email-drop-guide {
    margin-top: 0.55rem;
    text-align: left;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.email-drop-guide summary {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
}

.email-drop-guide summary:hover {
    color: #fff;
}

.email-drop-guide ul {
    margin: 0.5rem 0 0.35rem;
    padding-left: 1.25rem;
}

.email-drop-guide li {
    margin-bottom: 0.3rem;
}

/* Transient guidance shown when a drop delivers no file (Windows Outlook direct drags). */
.drop-feedback {
    display: none;
    margin: 0.6rem auto 0;
    max-width: 720px;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fde68a;
    font-size: 0.83rem;
    text-align: left;
    line-height: 1.45;
}

.drop-feedback.show {
    display: block;
}

/* ── Quote readiness panel (submission analysis) ─────────────────────────────── */

.readiness-request-list {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.9rem;
}

.readiness-request-list .readiness-request-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #854d0e;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.readiness-request-list ul {
    margin: 0;
    padding-left: 1.4rem;
    color: #713f12;
    font-size: 0.86rem;
}

.readiness-items {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.readiness-item {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    font-size: 0.86rem;
}

.readiness-chip {
    display: inline-block;
    min-width: 64px;
    text-align: center;
    padding: 0.08rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.readiness-verified { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.readiness-reported { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.readiness-partial  { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.readiness-missing  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.readiness-label {
    color: #0f172a;
}

.readiness-detail {
    color: #64748b;
    font-size: 0.78rem;
}

/* ── System-admin impersonation banner ─────────────────────────────────────────
   Shown at the very top of MainLayout (covers every impersonable surface) while an
   admin is signed in as another user. Deliberately loud so it can never be missed. */
.impersonation-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: linear-gradient(90deg, #b45309, #d97706);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.impersonation-banner .material-symbols-outlined { font-size: 20px; }
.impersonation-banner .impersonation-text { flex: 1 1 auto; line-height: 1.3; }
.impersonation-banner .impersonation-note { opacity: 0.9; }
.impersonation-banner .impersonation-return {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 0.25rem 0.7rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.impersonation-banner .impersonation-return:hover { background: rgba(255, 255, 255, 0.32); }
.impersonation-banner .impersonation-return .material-symbols-outlined { font-size: 16px; }

/* ============================================================================
   ADMIN CONSOLE DESIGN TOKENS + SHARED KIT
   ----------------------------------------------------------------------------
   Replaces the inline hex/font-size styles that were pasted across the admin
   pages. Two rules hold everything together:

     1. CHART MARKS wear the series colors; TEXT never does. Labels, values and
        legends stay in the ink tokens - a light categorical hue is illegible as
        text on a white card.
     2. STATUS colors are reserved and always ship with an icon + label, so a
        state is never carried by color alone.

   The series ramp is validated (OKLab CVD separation, chroma floor, lightness
   band, contrast) against a #ffffff card surface. Slots 1-3 clear the all-pairs
   floors and are safe for any chart form; past three, fold to "Other" or facet.
   Slot 3 sits at 2.8:1 on white, so any chart using it must carry visible
   labels or a table view - which the console does by construction.

   The app has no dark mode, so these are light-surface values only. Do not add
   a prefers-color-scheme block here: the surrounding chrome is hard-light, and
   a chart that flipped dark inside a light card would be worse than no theming.
   ========================================================================== */

/* .admin-main is included so EVERY page under AdminLayout is tokenized by
   construction. The .admin-scope opt-in was the original contract and two pages
   shipped without it - every var() then resolved to nothing, which does not
   throw and does not look obviously broken, so it survived a live walk that was
   checking figures. A layout that has to be opted into gets forgotten; one that
   comes with the layout cannot be. .admin-scope is kept for the panels that
   render inside NON-admin pages. */
.admin-scope,
.admin-main {
    /* Surfaces + ink */
    --admin-surface: #ffffff;
    --admin-plane: #f6f7f9;
    --admin-ink: #0b0b0b;
    --admin-ink-2: #52514e;
    --admin-ink-muted: #898781;
    --admin-hairline: #e4e6ea;
    --admin-grid: #eceef1;
    --admin-brand: #2d68ea;

    /* Series (marks only - never text) */
    --admin-series-1: #2a78d6;
    --admin-series-2: #eb6834;
    --admin-series-3: #1baf7a;

    /* Status (reserved - always with an icon + label) */
    --admin-good: #0ca30c;
    --admin-warning: #fab219;
    --admin-serious: #ec835a;
    --admin-critical: #d03b3b;

    --admin-radius: 10px;
    --admin-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

/* -- Section card ------------------------------------------------------- */
.admin-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-hairline);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
}

.admin-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--admin-hairline);
}

.admin-card-head.is-bare { border-bottom: none; padding-bottom: 0.25rem; }

.admin-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--admin-ink);
    margin: 0;
    line-height: 1.3;
}

.admin-card-sub {
    font-size: 0.78125rem;
    color: var(--admin-ink-muted);
    margin: 0.125rem 0 0;
    line-height: 1.35;
}

.admin-card-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.admin-card-body { padding: 1.125rem; }
.admin-card-body.is-flush { padding: 0; }

/* -- KPI / stat tile ---------------------------------------------------- */
.admin-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1rem 1.125rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-hairline);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    height: 100%;
    text-decoration: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

a.admin-kpi:hover {
    border-color: #cfd6e4;
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 4px 10px rgba(16, 24, 40, 0.08);
}

.admin-kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--admin-ink-muted);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.3125rem;
}

.admin-kpi-label .material-symbols-outlined { font-size: 15px; }

/* Proportional figures deliberately - tabular-nums makes a standalone value
   look loose at display size. Columns get tabular; hero values do not. */
.admin-kpi-value {
    font-size: 1.6875rem;
    font-weight: 600;
    color: var(--admin-ink);
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.admin-kpi-value.is-small { font-size: 1.25rem; }

.admin-kpi-foot {
    font-size: 0.75rem;
    color: var(--admin-ink-2);
    line-height: 1.35;
    margin-top: auto;
    padding-top: 0.125rem;
}

.admin-kpi-delta { font-weight: 600; }
.admin-kpi-delta.is-good { color: #006300; }
.admin-kpi-delta.is-bad { color: var(--admin-critical); }
.admin-kpi-delta.is-flat { color: var(--admin-ink-muted); }

/* -- Page head, KPI grid, and the small in-card helpers ------------------
   The TILE was styled from the start; its CONTAINER was not, so until this
   block landed a row of KPIs rendered as one full-width tile per line. Found
   by diffing the classes the admin pages reference against the ones this sheet
   defines - the kind of gap that is invisible while you are verifying that the
   numbers are right. Keep that diff in mind when adding an admin page. */
.admin-page-title { font-size: 1.375rem; font-weight: 600; color: var(--admin-ink); margin: 0; }
.admin-page-sub {
    font-size: 0.8125rem;
    color: var(--admin-ink-muted);
    margin: 0.1875rem 0 0;
    max-width: 78ch;          /* a measure, so the intro line stays readable */
    line-height: 1.45;
}

/* auto-fit, so four tiles fold to two then one without a single breakpoint. */
.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Inside a card: a smaller minimum (the container is already narrower) and no
   trailing margin, since the card supplies the spacing. */
.admin-kpi-grid-inline {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.625rem;
    margin-bottom: 0;
}

/* Window picker (7 / 30 / 90 days) - a segmented control, not a button row. */
.admin-window-picker {
    display: inline-flex;
    margin-left: auto;
    background: var(--admin-surface);
    border: 1px solid var(--admin-hairline);
    border-radius: var(--admin-radius);
    overflow: hidden;
}

.admin-window-btn {
    border: 0;
    background: transparent;
    padding: 0.375rem 0.8125rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--admin-ink-2);
    cursor: pointer;
    white-space: nowrap;
}

.admin-window-btn + .admin-window-btn { border-left: 1px solid var(--admin-hairline); }
.admin-window-btn:hover:not(:disabled):not(.is-active) { background: var(--admin-plane); }
.admin-window-btn.is-active { background: var(--admin-brand); color: #ffffff; }
.admin-window-btn:disabled { opacity: 0.5; cursor: default; }

/* Two-up section body. align-items:start on the -top variant so a short column
   does not stretch to match a tall one. */
.admin-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.25rem;
}
.admin-split-top { align-items: start; }

.admin-sub-head {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--admin-ink-2);
    margin: 0 0 0.5rem;
}

.admin-table-compact { font-size: 0.8125rem; margin-bottom: 0; }
.admin-table-compact > :not(caption) > * > * { padding: 0.4375rem 0.5rem; }
.admin-table-compact th {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--admin-ink-muted);
    border-bottom-color: var(--admin-grid);
}
.admin-table-compact td { border-bottom-color: var(--admin-grid); }

.admin-muted { color: var(--admin-ink-muted); }
.admin-cell-note { font-size: 0.75rem; line-height: 1.35; }

/* An empty state is a sentence, not a blank card - it has to say what is empty. */
.admin-empty-note {
    font-size: 0.8125rem;
    color: var(--admin-ink-muted);
    margin: 0;
    padding: 0.375rem 0;
}

/* -- Health verdict banner (Overview) -----------------------------------
   Carries an icon AND a sentence, never a color alone: the state has to survive
   a colorblind reader, a screenshot pasted into a doc, and forced-colors mode.
   The tint is reinforcement. */
.admin-verdict {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    margin-bottom: 1.25rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-hairline);
    border-left: 4px solid var(--admin-ink-muted);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.admin-verdict:hover { box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 4px 10px rgba(16, 24, 40, 0.08); }
.admin-verdict-icon { font-size: 26px; flex: 0 0 auto; }
.admin-verdict-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.admin-verdict-head { font-size: 0.9375rem; font-weight: 600; color: var(--admin-ink); }
.admin-verdict-sub { font-size: 0.8125rem; color: var(--admin-ink-2); line-height: 1.4; }
.admin-verdict-go { margin-left: auto; color: var(--admin-ink-muted); flex: 0 0 auto; }

.admin-verdict.is-good { border-left-color: var(--admin-good); }
.admin-verdict.is-good .admin-verdict-icon { color: var(--admin-good); }
.admin-verdict.is-warning { border-left-color: var(--admin-warning); }
.admin-verdict.is-warning .admin-verdict-icon { color: #a06f00; }  /* the token is a fill; this is ink */
.admin-verdict.is-critical { border-left-color: var(--admin-critical); }
.admin-verdict.is-critical .admin-verdict-icon { color: var(--admin-critical); }
.admin-verdict.is-unknown .admin-verdict-icon { color: var(--admin-ink-muted); }

/* -- Status badge (icon + label - never color alone) -------------------- */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem 0.125rem 0.375rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}

.admin-badge .material-symbols-outlined { font-size: 14px; }

.admin-badge.is-good { background: #e7f6e7; color: #05650c; border-color: #bfe6c1; }
.admin-badge.is-warning { background: #fdf3dc; color: #7a5300; border-color: #f2ddab; }
.admin-badge.is-serious { background: #fdeee7; color: #8c3d17; border-color: #f7d2c0; }
.admin-badge.is-critical { background: #fdeaea; color: #9a1f1f; border-color: #f5c6c6; }
.admin-badge.is-neutral { background: #f1f3f6; color: var(--admin-ink-2); border-color: #e0e4ea; }
.admin-badge.is-info { background: #e8f0fd; color: #17458f; border-color: #c8dbf8; }

/* -- Table -------------------------------------------------------------- */
.admin-table { width: 100%; margin: 0; border-collapse: collapse; }

.admin-table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-ink-muted);
    background: #fafbfc;
    border-bottom: 1px solid var(--admin-hairline);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    vertical-align: middle;
}

.admin-table thead th.is-sortable { cursor: pointer; user-select: none; }
.admin-table thead th.is-sortable:hover { color: var(--admin-ink-2); background: #f3f5f8; }

.admin-table thead th .sort-caret {
    font-size: 14px;
    vertical-align: -3px;
    margin-left: 0.125rem;
    opacity: 0.85;
}

.admin-table tbody td {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--admin-ink);
    border-bottom: 1px solid var(--admin-grid);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr.is-clickable { cursor: pointer; }
.admin-table tbody tr.is-clickable:hover { background: #f7f9fc; }

/* Columns of numbers align; standalone values do not. */
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table .muted { color: var(--admin-ink-muted); }
.admin-table .strong { font-weight: 600; }
.admin-table .wrap { white-space: normal; }

.admin-table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--admin-hairline);
    flex-wrap: wrap;
}

.admin-table-search {
    flex: 1 1 220px;
    max-width: 340px;
    font-size: 0.8125rem;
    padding: 0.3125rem 0.625rem;
    border: 1px solid var(--admin-hairline);
    border-radius: 7px;
    background: var(--admin-surface);
    color: var(--admin-ink);
}

.admin-table-search:focus {
    outline: none;
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(45, 104, 234, 0.12);
}

.admin-table-count { font-size: 0.75rem; color: var(--admin-ink-muted); margin-left: auto; }

.admin-table-pager {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--admin-hairline);
    font-size: 0.75rem;
    color: var(--admin-ink-2);
}

.admin-table-pager .btn { --bs-btn-padding-y: 0.125rem; --bs-btn-padding-x: 0.5rem; --bs-btn-font-size: 0.75rem; }

.admin-empty {
    padding: 2rem 1.125rem;
    text-align: center;
    color: var(--admin-ink-muted);
    font-size: 0.8125rem;
}

.admin-empty .material-symbols-outlined {
    display: block;
    font-size: 30px;
    opacity: 0.45;
    margin-bottom: 0.375rem;
}

/* -- Chart -------------------------------------------------------------- */
.admin-chart { display: block; width: 100%; overflow: visible; }
.admin-chart .grid { stroke: var(--admin-grid); stroke-width: 1; shape-rendering: crispEdges; }
.admin-chart .axis { stroke: var(--admin-hairline); stroke-width: 1; shape-rendering: crispEdges; }
.admin-chart .tick { font-size: 10px; fill: var(--admin-ink-muted); }
.admin-chart .val { font-size: 10.5px; fill: var(--admin-ink-2); font-weight: 600; }
.admin-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.admin-chart .dot { stroke: var(--admin-surface); stroke-width: 2; }

/* -- Misc --------------------------------------------------------------- */
.admin-page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin-page-head h1 { font-size: 1.375rem; font-weight: 600; color: var(--admin-ink); margin: 0; }
.admin-page-head .lead-sub { font-size: 0.8125rem; color: var(--admin-ink-muted); margin: 0.1875rem 0 0; }
.admin-page-head .spacer { margin-left: auto; }

.admin-crumb { font-size: 0.78125rem; color: var(--admin-ink-muted); margin-bottom: 0.375rem; }
.admin-crumb a { color: var(--admin-ink-2); text-decoration: none; }
.admin-crumb a:hover { color: var(--admin-brand); text-decoration: underline; }

.admin-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: #fdeaea;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #9a1f1f;
}

.admin-error .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }

.admin-note { font-size: 0.75rem; color: var(--admin-ink-muted); line-height: 1.45; }

.admin-defs dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--admin-ink-muted); font-weight: 600; }
.admin-defs dd { font-size: 0.8125rem; color: var(--admin-ink); margin-bottom: 0.75rem; }

/* ── Policy comparison grid — difference highlighting ──────────────────────────────────────
   The grid's whole job is showing where two policies are NOT the same. Before 2026-08 nearly
   every row was one-sided (the row key was the whole printed coverage label, so any wording
   difference split one coverage into two rows), which made the grid read as a list of each
   policy's contents rather than a comparison. With the rows now matching, these styles are what
   make the remaining differences findable at a glance. */

/* Colour is never the only signal — the ≠ chip carries a title, and a missing cell says
   "Not carried" / "Not scheduled" in words. */
.cmp-diff-chip {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0 0.35rem;
    border-radius: 4px;
    background: #b45309;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: middle;
    cursor: help;
}

/* A row where the policies disagree. */
.cmp-cell-diff { background: rgba(245, 158, 11, 0.09); }

/* A policy that does not carry this line at all — the strongest finding in the grid, so it
   reads differently from "carries it with different numbers". */
.cmp-cell-missing {
    background: rgba(148, 163, 184, 0.16);
    color: #64748b;
    font-style: italic;
}

/* The highest stated limit among the compared policies. Kept subtle: "highest limit" is not
   the same as "best coverage", and the ranking card is where that judgement belongs. */
.cmp-cell-best { background: rgba(16, 185, 129, 0.10); }
.cmp-cell-diff.cmp-cell-best { background: rgba(16, 185, 129, 0.14); }

/* This policy's own wording, shown only when the row matched two different phrasings so the
   reader can check the match rather than take it on trust. */
.cmp-cell-wording {
    font-size: 0.75rem;
    color: #475569;
    font-style: italic;
    margin-bottom: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AviaIntel Aircraft → Photos sub-mode (AircraftPhotosPanel) + the
   photograph-provenance card on the aircraft results.

   The panel lives inside .hero-section, which sets `color: white` — so any text
   here that must be dark states its own colour. The same trap that made the
   analysis progress dialog render white-on-white.
   ═══════════════════════════════════════════════════════════════════════════ */

.photos-panel { text-align: left; }

.photos-intro {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.photos-intro .material-symbols-outlined { font-size: 1.4rem; opacity: 0.9; }
.photos-intro-sub { font-size: 0.8rem; opacity: 0.75; margin-top: 0.15rem; line-height: 1.4; }

.photos-hint { font-size: 0.78rem; opacity: 0.75; margin-top: 0.35rem; line-height: 1.45; }

.photos-list { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }

.photos-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 8px;
    padding: 0.5rem;
}
.photos-thumb {
    width: 64px; height: 48px; object-fit: cover;
    border-radius: 4px; flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
}
.photos-item-body { flex: 1; min-width: 0; }
.photos-item-name {
    font-size: 0.8rem; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photos-item-controls { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.3rem; }
.photos-item-controls .form-select { max-width: 190px; }

/* ── Confirm step. A white card on the dark hero, so it sets its own colour. ── */
.photos-confirm {
    background: #fff;
    color: #1f2937;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    text-align: left;
}
.photos-confirm .photos-hint { opacity: 1; color: #64748b; }
.photos-confirm-head {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 1.02rem; margin-bottom: 0.75rem;
    padding-bottom: 0.6rem; border-bottom: 1px solid #e2e8f0;
}
.photos-confirm-head .material-symbols-outlined { color: #2d68ea; }
.photos-confirm-reg { max-width: 260px; margin-bottom: 0.9rem; }

.photos-corrob {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
}
.photos-corrob-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.82rem; font-weight: 600; color: #475569;
    margin-bottom: 0.4rem;
}
.photos-corrob table { font-size: 0.85rem; margin-bottom: 0; }
.photos-corrob th { font-weight: 600; color: #64748b; font-size: 0.76rem; }
/* Never colour alone — the row also carries a "Does not match" badge above the table. */
.photos-corrob-bad { background: #fef2f2; }
.photos-corrob-bad td { color: #b91c1c; }
.photos-corrob-note td { font-size: 0.78rem; color: #64748b; font-style: italic; }
.photos-source { font-size: 0.72rem; color: #94a3b8; display: block; }

.photos-observed { margin-top: 0.75rem; }
.photos-observed-group { margin-bottom: 0.6rem; }
.photos-observed-title {
    font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em;
    text-transform: uppercase; color: #64748b; margin-bottom: 0.35rem;
}
.photos-chip {
    display: inline-block;
    background: #eef2ff; color: #3730a3;
    border: 1px solid #c7d2fe; border-radius: 999px;
    font-size: 0.8rem; padding: 0.15rem 0.6rem;
    margin: 0 0.3rem 0.3rem 0;
}
.photos-chip-note { font-size: 0.7rem; opacity: 0.8; margin-left: 0.3rem; }

.photos-stc { margin-top: 0.75rem; }
.photos-stc-row { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.5rem; }
.photos-stc-row .badge { flex-shrink: 0; margin-top: 0.1rem; }
.photos-stc-obs { font-size: 0.85rem; font-weight: 600; }
.photos-stc-statement { font-size: 0.8rem; color: #64748b; line-height: 1.4; }
.photos-stc-cand { font-size: 0.8rem; margin-top: 0.15rem; }

.photos-notes {
    font-size: 0.8rem; color: #64748b;
    margin: 0.75rem 0 0; padding-left: 1.1rem;
}
.photos-confirm-actions {
    display: flex; align-items: center; gap: 0.75rem;
    margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #e2e8f0;
}

/* The provenance card on the results pane sits on a white surface already. */
.analysis-card .photos-observed-group,
.analysis-card .photos-stc { margin-top: 0.6rem; }
.analysis-card .photos-hint { color: #64748b; opacity: 1; }

/* ── Unified Avia sessions — running-analysis strip (chat page) ───────────── */
.chat-session-running-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0;
    padding: 0.5rem 0.75rem;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #155e75;
}

.chat-session-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(6, 182, 212, 0.25);
    border-top-color: #06b6d4;
    border-radius: 50%;
    flex-shrink: 0;
    animation: chatSessionSpin 0.9s linear infinite;
}

@keyframes chatSessionSpin {
    to { transform: rotate(360deg); }
}

/* Failed-session strip + the session Cancel/Retry action button (unified sessions US-P6). */
.chat-session-failed-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #991b1b;
}

.chat-session-action-btn {
    flex-shrink: 0;
    padding: 0.3rem 0.75rem;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.chat-session-action-btn:hover { background: rgba(0, 0, 0, 0.05); }

.chat-session-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Chat-sessions cross-link banner on /intel (US-P7). Lives inside .hero-section, which paints
   white text — so every color here is explicit (the progress-dialog lesson). */
.intel-sessions-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 auto 1rem;
    max-width: 640px;
    padding: 0.55rem 0.85rem;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.45);
    border-radius: 10px;
    font-size: 0.84rem;
    color: #e0f2fe;
}

.intel-sessions-banner a {
    color: #67e8f9;
    font-weight: 600;
    text-decoration: underline;
}

.intel-sessions-banner a:hover { color: #a5f3fc; }

.intel-sessions-banner .material-symbols-outlined { color: #67e8f9; }

.intel-sessions-banner button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #bae6fd;
    cursor: pointer;
}

.intel-sessions-banner button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Pilot-certificate drag & drop zone — shared by the /intel Pilot pill and the AviAMS
   submission wizard's "Add from certificate photo" panel. Sits on WHITE cards, so the global
   .drop-feedback (styled for the dark hero) gets a light-surface override below. */
.pilot-cert-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px dashed #c7d8f7;
    border-radius: 10px;
    background: #f6f9fe;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.pilot-cert-dropzone:hover,
.pilot-cert-dropzone.drop-active {
    border-color: #2d68ea;
    background: #eef4ff;
}

.pilot-cert-dropzone.busy {
    opacity: 0.65;
    cursor: progress;
}

.pilot-cert-drop-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
}

.pilot-cert-drop-sub {
    font-size: 0.78rem;
    color: #64748b;
}

/* Ownership panel — pilot-roster drop zone. Sits INSIDE the dark hero's translucent notes panel,
   so it is the dark-surface twin of .pilot-cert-dropzone (which is styled for a white card). */
.ownership-roster-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: calc(100% - 1.5rem);
    box-sizing: border-box;
    margin: 0.5rem 0.75rem 0;
    padding: 0.7rem 0.9rem;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.ownership-roster-dropzone:hover,
.ownership-roster-dropzone.drop-active {
    border-color: #67e8f9;
    background: rgba(103, 232, 249, 0.12);
}

.ownership-roster-dropzone.busy {
    opacity: 0.65;
    cursor: progress;
}

.ownership-roster-drop-sub {
    font-size: 0.76rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    max-width: 640px;
}

.pilot-cert-dropzone .drop-feedback {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #92400e;
}
/* ── Web search sources (chat answers + analysis cards) — markup from WebSourcesHtml ── */
.web-sources { margin-top: .75rem; padding-top: .5rem; border-top: 1px solid rgba(100, 116, 139, .25); font-size: .85rem; }
.web-sources-title { display: flex; align-items: center; gap: .35rem; font-weight: 600; margin-bottom: .25rem; }
.web-sources-title .material-symbols-outlined { font-size: 1.05rem; }
.web-sources-list { list-style: none; margin: 0; padding: 0; }
.web-sources-list li { margin: .15rem 0; overflow-wrap: anywhere; }
.web-source-num { display: inline-block; min-width: 2.4em; color: #64748b; font-variant-numeric: tabular-nums; }
.web-source-domain, .web-source-age { color: #64748b; margin-left: .35rem; font-size: .8rem; }
.web-sources-note { color: #94a3b8; font-size: .75rem; margin-top: .35rem; }
/* ── Business analysis web research card + profile field citations ── */
.web-research-intro { color: var(--tv-text-muted); font-size: .9rem; margin: 0 0 .5rem; }
.web-research-findings { font-size: .92rem; }
.web-research-findings ul { margin-bottom: .25rem; padding-left: 1.2rem; }
.web-cite { font-size: .72em; vertical-align: super; margin-left: .15rem; text-decoration: none; white-space: nowrap; }
.web-cite:hover { text-decoration: underline; }
