:root {
    color-scheme: only light;
    --background: #f1f5f9;
    --surface: #fff;
    --raised: #f1f6fa;
    --line: #d6e1eb;
    --text: #10283f;
    --muted: #4f657c;
    --blue: #075b9b;
    --accent: #116ab0;
    --blue-surface: #e7f2fc;
    --blue-line: #bcd7ed;
    --green: #136b51;
    --green-surface: #e9f7ef;
    --amber: #8a5410;
    --amber-surface: #fff2dc;
    --page-heading-size: clamp(1.8rem, 3vw, 2.5rem);
    --section-heading-size: clamp(1.2rem, 1.85vw, 1.6rem);
    --subheading-size: 1.08rem;
    font: 1rem/1.5 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: var(--page-heading-size); font-weight: 760; letter-spacing: -.045em; line-height: 1.13; overflow-wrap: anywhere; }
h2 { font-size: var(--section-heading-size); font-weight: 750; letter-spacing: -.03em; line-height: 1.2; }
h3 { font-size: var(--subheading-size); font-weight: 700; line-height: 1.25; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
button, input, select { color: inherit; font: inherit; }
button, a.button { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
[hidden] { display: none !important; }

.icon { flex: none; inline-size: 1rem; block-size: 1rem; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 10.875rem minmax(0, 1fr); }
.sidebar { padding: 1.25rem .65rem .75rem; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.brand { display: block; color: var(--text); text-decoration: none; font-size: 1.7rem; line-height: 1; font-weight: 900; font-style: italic; letter-spacing: -.075em; }
.brand span { color: var(--accent); }
.sidebar .brand, .portal-name { padding-inline: .65rem; }
.portal-name, .eyebrow { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.portal-name { margin-top: .55rem; }
.sidebar nav { display: grid; gap: .25rem; margin-top: 1.45rem; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; min-height: 2.35rem; border: 1px solid transparent; border-radius: .45rem; padding: .44rem .55rem; color: var(--muted); text-decoration: none; font-size: .9rem; }
.sidebar nav a:hover { background: var(--raised); color: var(--text); }
.sidebar nav a[aria-current="page"] { color: var(--blue); background: var(--blue-surface); border-color: var(--blue-line); }
.sidebar nav a[aria-current="page"] .icon { color: var(--blue); }
.sidebar-account { margin-top: auto; padding: .7rem .3rem 0; border-top: 1px solid var(--line); display: flex; gap: .5rem; align-items: center; font-size: .86rem; overflow-wrap: anywhere; }
.sidebar-account span { display: block; font-size: .85rem; color: var(--muted); }
.sidebar-account .avatar { inline-size: 2rem; block-size: 2rem; font-size: .72rem; }
.content { width: min(100%, 84rem); min-width: 0; margin-inline: auto; padding: clamp(.85rem, 2.25vw, 2rem); display: grid; align-content: start; gap: .875rem; }
.page-header, .section-header { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: center; justify-content: space-between; }
.page-header { min-height: 2.25rem; margin-bottom: .2rem; }
.header-status, .sync-label { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.header-status { gap: .75rem; }
.sync-label { color: var(--muted); font-size: .8rem; }
.sync-label .icon { color: var(--green); }
.section-header h2, .section-header h3 { display: flex; align-items: center; gap: .48rem; }
.section-header h2 .icon { color: var(--blue); }
.stack { display: grid; gap: .875rem; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.panel { min-width: 0; padding: clamp(.85rem, 1.45vw, 1.2rem); border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.hero { padding: clamp(1rem, 2.65vw, 1.75rem); border: 1px solid var(--blue-line); border-radius: .75rem; background: linear-gradient(120deg, #f9fcff, #e1f0fc); }
.next-flight { display: grid; gap: 1.1rem; }
.next-flight .badge { color: var(--blue); background: #d6e9f9; }
.hero-route { display: flex; align-items: flex-start; gap: clamp(.65rem, 2.6vw, 1.75rem); }
.airport { min-width: 0; }
.airport strong { display: block; font-size: clamp(1.9rem, 5.1vw, 3.25rem); font-weight: 750; letter-spacing: -.065em; line-height: 1; }
.airport span { display: block; margin-top: .28rem; color: var(--muted); font-size: .88rem; }
.flight-path { display: flex; gap: .35rem; align-items: center; width: clamp(2.8rem, 14vw, 9.6rem); margin-top: clamp(.45rem, 1.65vw, 1rem); color: var(--blue); }
.flight-path::before, .flight-path::after { content: ''; flex: 1; height: 1px; background: #8eb4d2; }
.hero-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .9rem; }
.hero-footer p { color: var(--muted); font-size: .9rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .65rem clamp(.9rem, 3vw, 1.9rem); }
.hero-meta div { display: block; border: 0; padding: 0; }
.hero-meta dt { color: var(--muted); font-size: .79rem; }
.hero-meta dd { margin-top: .12rem; text-align: left; font-size: .93rem; font-weight: 650; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: .875rem; align-items: start; }
.overview-grid section[aria-labelledby="recent-heading"] { align-self: stretch; grid-template-rows: auto 1fr auto; }
.recent-empty { display: grid; align-content: center; justify-items: start; gap: .35rem; min-height: 6.25rem; }
.card-footer { border-top: 1px solid var(--line); padding-top: .65rem; }
.summary-value { font-size: clamp(1.03rem, 2vw, 1.38rem); line-height: 1.2; font-weight: 700; letter-spacing: -.026em; }
.meter { display: block; width: 100%; height: .38rem; border: 0; appearance: none; }
.meter::-webkit-progress-bar { background: var(--raised); border-radius: .3rem; }
.meter::-webkit-progress-value { background: var(--accent); border-radius: .3rem; }
.meter::-moz-progress-bar { background: var(--accent); border-radius: .3rem; }
.migration { background: #eaf3fb; }
.footer-note { color: var(--muted); font-size: .8rem; }
.small { font-size: .85rem; }
.text-link { color: var(--blue); font-size: .85rem; font-weight: 630; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.badge { display: inline-flex; width: fit-content; white-space: nowrap; padding: .2rem .58rem; border-radius: 999px; font-size: .84rem; font-weight: 640; background: var(--raised); color: var(--muted); }
.badge.staging { color: var(--amber); background: var(--amber-surface); }
.badge.active { color: var(--green); background: var(--green-surface); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; width: fit-content; min-height: 2.4rem; padding: .42rem .72rem; background: var(--surface); border: 1px solid var(--line); border-radius: .44rem; color: var(--text); font-size: .91rem; font-weight: 630; text-decoration: none; }
.button:hover { background: var(--raised); }
.button.primary { color: var(--surface); background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--blue); border-color: var(--blue); }
.muted, dt { color: var(--muted); }
.message { padding: .7rem .9rem; border-left: 3px solid var(--green); background: var(--green-surface); border-radius: .35rem; }
.message.error { border-color: var(--amber); background: var(--amber-surface); }
.account-summary { display: flex; align-items: center; gap: .75rem; }
.avatar { flex: none; display: grid; place-items: center; inline-size: 2.85rem; block-size: 2.85rem; border-radius: 50%; background: var(--blue-surface); color: var(--blue); font-size: .83rem; font-weight: 800; }
.license + .license { border-top: 1px solid var(--line); padding-top: 1rem; }
dl { font-variant-numeric: tabular-nums; }
dl div { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
dl div:last-child { border-bottom: 0; }
dd { text-align: right; overflow-wrap: anywhere; }
.sensitive, code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; overflow-wrap: anywhere; }
.upload-form, .filter { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.upload-form label, .filter label { display: grid; gap: .26rem; font-size: .92rem; }
.upload-form label:first-of-type { flex: 0 1 18.4rem; min-width: 0; max-width: 100%; }
input[type="file"], select { min-height: 2.65rem; max-width: 100%; padding: .43rem .65rem; border: 1px solid var(--line); border-radius: .44rem; background: var(--background); }
.upload-form input[type="file"] { width: 100%; min-width: 0; }
select {
    appearance: none;
    padding-right: 1.9rem;
    background-image: linear-gradient(45deg, transparent 46%, var(--muted) 47%, var(--muted) 67%, transparent 68%), linear-gradient(-45deg, transparent 46%, var(--muted) 47%, var(--muted) 67%, transparent 68%);
    background-position: right .96rem center, right .64rem center;
    background-size: .35rem .35rem;
    background-repeat: no-repeat;
}
.upload-status { flex-basis: 100%; }
.support-columns { align-items: start; }
.support-guidance p { color: var(--muted); overflow-wrap: anywhere; }
.support-channel { display: grid; gap: .4rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.support-email-notice { color: #a61b1b; }
.button.support-discord-button { background: #4e46c7; border-color: #4e46c7; color: #fff; }
.button.support-discord-button:hover { background: #3d35aa; border-color: #3d35aa; }
.flight-row .badge.support-status { display: inline-flex; align-self: start; }
.support-status[data-status="new"] { background: #dceeff; color: #124e86; }
.support-status[data-status="investigating"] { background: #eee5ff; color: #5a3187; }
.support-status[data-status="awaiting_pilot"] { background: #ffedc4; color: #775000; }
.support-status[data-status="ready_for_retest"] { background: #d7f3f3; color: #155c62; }
.support-status[data-status="closed"] { background: #dff3e3; color: #205b36; }
.support-form { display: grid; gap: .8rem; }
.support-form label { display: grid; align-content: end; gap: .25rem; font-size: .94rem; min-width: 0; }
.support-form input, .support-form textarea { width: 100%; min-width: 0; padding: .48rem .58rem; border: 1px solid var(--line); border-radius: .44rem; background: var(--background); color: inherit; font: inherit; }
.support-fields :is(input, select) { min-height: 2.65rem; }
.support-form textarea { resize: vertical; }
.support-message { border-top: 1px solid var(--line); padding-top: .8rem; }
.support-body, .support-columns .flight-row strong { white-space: pre-wrap; overflow-wrap: anywhere; }
.flight-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-block: .7rem; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.flight-row:hover strong { color: var(--blue); }
.flight-row span:not(.glyph) { display: block; }
.flight-ident { display: flex; gap: .55rem; align-items: center; min-width: 0; color: var(--text); text-decoration: none; }
.flight-ident:hover strong { color: var(--blue); }
.glyph { display: grid; place-items: center; flex: none; inline-size: 2.05rem; block-size: 2.05rem; background: var(--raised); border-radius: .45rem; color: var(--blue); }
.flight-meta { text-align: right; font-variant-numeric: tabular-nums; }
.flight-meta span, a.flight-row span { display: block; color: var(--muted); font-size: .85rem; }
.recent-flights .flight-row { padding-block: .5rem; }
.recent-flights .flight-row:first-child { border-top: 0; }
.route { font-size: clamp(1.4rem, 4vw, 2.15rem); letter-spacing: -.05em; }
.report-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
.report-details div:last-child { border-bottom: 1px solid var(--line); }
.pagination { display: flex; gap: .55rem; }
.login { min-height: 100vh; padding: 1.2rem; display: grid; place-items: center; background: radial-gradient(ellipse at 80% 0%, #dceefd, transparent 65%); }
.login-content { display: grid; gap: 1rem; width: min(100%, 34rem); padding: clamp(1.4rem, 5vw, 2.65rem); border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.login-content .brand { margin-bottom: .45rem; }
dialog { width: min(32rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto; padding: 1.2rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #10283f55; }

@media (max-width: 735px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { display: grid; gap: .5rem; padding: .9rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar .brand, .portal-name { padding: 0; margin: 0; }
    .sidebar nav { margin: 0; display: flex; flex-wrap: wrap; }
    .sidebar-account { display: none; }
    .columns, .report-details, .overview-grid { grid-template-columns: 1fr; }
}


/* Career, Company and Dispatch share the same uploaded-save and planning layout. */
:root { --background: #f3f6fa; --line: #dbe4ed; --text: #142d43; --muted: #526a80; --accent: #076aba; }
.work-header { gap: .75rem; align-items: flex-start; }
.work-header .header-status { justify-content: flex-end; }
.work-header h1 + p { margin-top: .35rem; }
.work-identity { font-weight: 650; overflow-wrap: anywhere; }
.work-identity .badge { margin-inline-start: .35rem; vertical-align: middle; }
.work-header .button, .work-columns .button, .save-filter .button { min-height: 2.75rem; }
.snapshot-freshness { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .28rem; color: var(--muted); font-size: .84rem; margin-top: .32rem; font-variant-numeric: tabular-nums; }
.snapshot-freshness span { margin-inline-start: .4rem; }
.snapshot-freshness time { color: var(--text); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .85rem; }
.metric-grid .metric { display: grid; justify-content: start; gap: .35rem; min-width: 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.metric dt { font-size: .86rem; line-height: 1.3; }
.metric dd { color: var(--text); text-align: start; font-size: clamp(1.24rem, 2.1vw, 1.65rem); font-weight: 735; letter-spacing: -.04em; }
.work-columns { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.work-columns > * { min-width: 0; }
.work-columns .panel { min-width: 0; padding: clamp(.9rem, 1.55vw, 1.35rem); }
.plan-highlight { background: linear-gradient(120deg, #fff, #f0f7fd); border-color: var(--blue-line); }
.plan-highlight .route { line-height: 1.15; font-weight: 730; }
.table-region { min-width: 0; max-width: 100%; overflow: auto; }
.work-table { border-collapse: collapse; width: 100%; text-align: start; font-size: .92rem; }
.work-table th, .work-table td { padding: .43rem .57rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.work-table thead th { color: var(--muted); font-size: .83rem; font-weight: 670; background: var(--raised); text-align: start; }
.work-table tbody th { font-weight: 650; text-align: start; }
.work-table tbody tr:last-child > * { border-bottom: 0; }
.work-table tr:target { background: var(--blue-surface); }
.work-table small { display: block; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.work-table .numeric { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.work-table .nowrap { white-space: nowrap; }
.work-table .row-action { min-height: 2.35rem; padding-inline: .6rem; color: var(--blue); }
.ledger-table { min-width: 13rem; }
.work-facts { min-width: 0; }
.work-facts dd { overflow-wrap: anywhere; }
.attention-list { list-style: none; display: grid; padding: 0; margin: 0; gap: .6rem; }
.attention-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem .65rem; align-items: center; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.mode-option { min-width: 0; display: flex; gap: .65rem; align-items: start; border: 1px solid var(--line); border-radius: .65rem; padding: .78rem .95rem; color: var(--text); text-decoration: none; background: var(--surface); }
.mode-option:hover { border-color: var(--blue-line); background: var(--raised); }
.mode-option[aria-current="page"] { box-shadow: inset 0 -3px var(--accent); border-color: var(--blue-line); background: var(--blue-surface); }
.mode-option > span, .mode-option strong, .mode-option .muted { display: block; }
.mode-option .muted { font-size: .84rem; }
.mode-option .icon { color: var(--blue); margin-top: .22rem; }
.save-filter { padding: .65rem .8rem; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.work-columns .save-filter { padding: 0; border: 0; }
.work-filter label, .save-filter label { min-width: 0; max-width: 100%; }
.work-filter label { flex: 1 1 14rem; }
.dispatch-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.dispatch-fields label { display: grid; min-width: 0; align-content: end; gap: .24rem; font-size: .9rem; }
.dispatch-fields .full-field { grid-column: 1 / -1; }
.dispatch-fields input, .dispatch-fields select { width: 100%; min-height: 2.75rem; min-width: 0; }
.dispatch-fields input { padding: .46rem .6rem; background: var(--background); border: 1px solid var(--line); border-radius: .44rem; }
.dispatch-fields :is(input[name="origin"], input[name="destination"], input[name="alternate"], input[name="flightNumber"]) { text-transform: uppercase; }
.planning-details { padding-block: .55rem; border-block: 1px solid var(--line); }
.planning-details > summary { color: var(--blue); font-weight: 650; cursor: pointer; }
.planning-details > .dispatch-fields { padding: .7rem 0 .25rem; }
.planning-details > button { margin-top: .55rem; }
.form-actions, .connection-status { display: flex; flex-wrap: wrap; gap: .55rem .75rem; align-items: center; }
.message.attention { border-color: var(--amber); background: var(--amber-surface); }
.work-columns .button:disabled { cursor: not-allowed; }

@media (min-width: 1100px) {
    .shell { grid-template-columns: 13.5rem minmax(0, 1fr); }
    .content { width: min(100%, 90rem); }
}
@media (max-width: 1040px) {
    .work-columns { grid-template-columns: minmax(0, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .mode-grid { grid-template-columns: 1fr; }
    .work-header .header-status { justify-content: flex-start; }
    .dispatch-fields { grid-template-columns: 1fr; }
    .metric-grid .metric { padding: .75rem; }
    .snapshot-freshness span { margin-inline-start: 0; }
}
@media (max-width: 360px) {
    .metric-grid { grid-template-columns: 1fr; }
}

