/* FT3M design tokens. Keep in sync with Theme/Ft3mTheme.cs. */
:root {
    --ft-apron: #0B1E36;
    --ft-apron-deep: #081627;
    --ft-sky: #17395F;
    --ft-altimeter: #2F7FB8;
    --ft-altimeter-deep: #245F8C;
    --ft-chalk: #F3F5F8;
    --ft-chalk-deep: #E6EBF1;
    --ft-stencil: #1E2A38;
    --ft-stencil-soft: #5B6775;
    --ft-streamer: #C8102E;
    --ft-caution: #E3B341;
    --ft-clear: #2E8B57;
    --ft-line: #D5DBE3;
    --ft-font-display: "Bahnschrift", "DIN Alternate", "Arial Narrow", sans-serif;
    --ft-font-body: "Segoe UI", "Segoe UI Variable Text", system-ui, sans-serif;
    /* Corner radius follows hierarchy: small controls, working surfaces, floating layers. */
    --ft-radius-xs: 4px;
    --ft-radius-sm: 8px;
    --ft-radius: 12px;
    --ft-radius-lg: 18px;
    --ft-radius-pill: 999px;

    /* Width of a form page (editor): its header and cards share it. */
    --ft-editor-width: 1280px;

    /* Only raised layers (dialogs, sticky action bar, the data plate) cast a shadow; it is tinted with the apron navy. */
    --ft-shadow-raised: 0 1px 2px rgba(11, 30, 54, 0.06), 0 14px 36px -18px rgba(11, 30, 54, 0.35);
    --ft-shadow-soft: 0 1px 2px rgba(11, 30, 54, 0.05);
}

html, body, #app {
    height: 100%;
    margin: 0;
}

body {
    background: var(--ft-chalk);
    color: var(--ft-stencil);
    font-family: var(--ft-font-body);
    -webkit-font-smoothing: antialiased;
}

.ft-shell--bare {
    min-height: 100vh;
}

.ft-wordmark {
    font-family: var(--ft-font-display);
    font-weight: 700;
    font-size: 7.5rem;
    line-height: 0.9;
    letter-spacing: 0.02em;
    color: #FFFFFF;
    text-decoration: none;
}

.ft-wordmark--rail {
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: 0.08em;
}

/* ---------- MudBlazor base adjustments ---------- */

.mud-button-root,
.mud-input-outlined .mud-input-outlined-border,
.mud-alert,
.mud-chip,
.mud-snackbar,
.mud-list-item {
    border-radius: var(--ft-radius-sm) !important;
}

.mud-icon-button {
    border-radius: 50% !important;
}

.mud-paper,
.mud-popover {
    border-radius: var(--ft-radius) !important;
}

.mud-dialog {
    border-radius: var(--ft-radius-lg) !important;
    box-shadow: var(--ft-shadow-raised) !important;
}

.mud-dialog-actions {
    padding: 12px 20px 18px;
    gap: 6px;
}

.mud-popover .mud-list {
    padding: 6px;
}

.mud-button-filled,
.mud-button-filled:hover {
    box-shadow: none !important;
}

.mud-dialog-title {
    font-family: var(--ft-font-display);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding-bottom: 8px;
}

.mud-dialog-content {
    padding-top: 12px;
}

/* A dialog action that belongs to the dialog's content rather than its outcome (a guide link) sits at the left. */
.dialog-actions__start {
    margin-right: auto;
}

/* ---------- Step-through guide (GuideShell) ---------- */

.guide {
    display: grid;
    gap: 16px;
}

.guide__steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ft-line);
}

.guide__step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-pill);
    background: #fff;
    color: var(--ft-stencil-soft);
    font: inherit;
    font-size: 0.84rem;
    cursor: pointer;
}

.guide__step:hover {
    border-color: var(--ft-altimeter);
    color: var(--ft-stencil);
}

.guide__step:focus-visible {
    outline: 2px solid var(--ft-altimeter);
    outline-offset: 2px;
}

.guide__no {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ft-chalk-deep);
    font-family: var(--ft-font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.guide__step.is-done .guide__no {
    background: rgba(47, 127, 184, 0.14);
    color: var(--ft-altimeter-deep);
}

.guide__step.is-current {
    border-color: var(--ft-apron);
    color: var(--ft-stencil);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--ft-caution);
}

.guide__step.is-current .guide__no {
    background: var(--ft-apron);
    color: #fff;
}

.guide__body {
    display: grid;
    gap: 14px;
    align-content: start;
    min-height: 360px;
}

/* A button in a step (open the other guide) keeps its own width. */
.guide__body > .mud-button-root {
    justify-self: start;
}

.guide__title {
    margin: 0;
    font-family: var(--ft-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ft-apron);
}

.guide__subhead {
    margin: 6px 0 0;
    font-family: var(--ft-font-display);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ft-stencil);
}

.guide__lead {
    margin: 0;
    color: var(--ft-stencil);
    line-height: 1.55;
}

.guide__note {
    margin: 0;
    color: var(--ft-stencil-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.guide__count {
    margin-right: auto;
    color: var(--ft-stencil-soft);
    font-family: var(--ft-font-display);
    font-variant-numeric: tabular-nums;
}

/* A phone keeps the step numbers and names only the current step. */
@media (max-width: 600px) {
    .guide__step:not(.is-current) .guide__label {
        display: none;
    }

    .guide__step:not(.is-current) {
        padding-right: 5px;
    }

    .guide__body {
        min-height: 0;
    }
}

.mud-alert.mud-alert-outlined-error {
    border-left-width: 3px;
    background: rgba(200, 16, 46, 0.05);
}

.mud-snackbar {
    font-family: var(--ft-font-body);
}

/* A message's follow-up button ("Yeni ekle") keeps its words on one line. */
.mud-snackbar-content-action > button {
    white-space: nowrap;
}

/* ---------- Login ---------- */

/* Like TACOM: the attitude indicator fills the screen, one card in the middle holds the brand and the sign-in steps. */
.login {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 40px 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #C9DFF5 0%, #DFECF9 42%, #F1F7FD 78%, #FFFFFF 100%);
}

.login__backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 40% at 50% 46%, rgba(255, 255, 255, 0.9) 0%, rgba(223, 236, 249, 0.4) 45%, transparent 72%),
        radial-gradient(ellipse 30% 18% at 12% 18%, rgba(255, 255, 255, 0.7) 0%, transparent 70%),
        radial-gradient(ellipse 34% 20% at 88% 80%, rgba(47, 127, 184, 0.16) 0%, transparent 70%);
}

.login__backdrop::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 68%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(47, 127, 184, 0.35) 20%, rgba(227, 179, 65, 0.6) 50%, rgba(47, 127, 184, 0.35) 80%, transparent);
}



.login__card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 860px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 24px 60px -24px rgba(23, 57, 95, 0.35), 0 2px 6px rgba(23, 57, 95, 0.06);
}

.login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 32px;
    text-align: center;
    color: var(--ft-apron);
    background: linear-gradient(165deg, #F0F6FF 0%, #CFE2F7 100%);
}

/* The aircraft symbol of the attitude indicator in a ring, with two slow pulses (TACOM's logo rings). */
.login__emblem {
    position: relative;
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    margin-bottom: 8px;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #DCEAF8 75%);
    box-shadow: 0 10px 30px -12px rgba(23, 57, 95, 0.45);
}

.login__emblem::before,
.login__emblem::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(47, 127, 184, 0.35);
    border-radius: 50%;
    animation: login-pulse 3.2s ease-out infinite;
}

.login__emblem::after {
    animation-delay: 1.6s;
}

.login__emblem svg {
    width: 80px;
    fill: none;
    stroke: var(--ft-altimeter-deep);
    stroke-width: 4;
    stroke-linejoin: round;
}

.login__emblem circle {
    fill: var(--ft-caution);
    stroke: none;
}

@keyframes login-pulse {
    from { transform: scale(1); opacity: 0.9; }
    to { transform: scale(1.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .login__emblem::before,
    .login__emblem::after {
        animation: none;
        opacity: 0;
    }
}

.login__wordmark {
    font-family: var(--ft-font-display);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.24em;
    margin-right: -0.24em;
    line-height: 1;
    color: var(--ft-apron);
}

.login__tagline {
    max-width: 24ch;
    font-family: var(--ft-font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--ft-stencil-soft);
}

.login__pill {
    margin-top: 14px;
    padding: 3px 12px;
    border: 1px solid rgba(23, 57, 95, 0.2);
    border-radius: var(--ft-radius-pill);
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--ft-font-display);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--ft-sky);
}


.login__panel {
    display: flex;
    flex-direction: column;
    padding: 24px 36px 18px;
    min-width: 0;
}

.login__top {
    display: flex;
    justify-content: flex-end;
}

.login__body {
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 12px 0 20px;
}

.login__title {
    font-family: var(--ft-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin: 0 0 6px;
    color: var(--ft-stencil);
}

.login__lead {
    margin: 0 0 22px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--ft-stencil-soft);
}

.login__form {
    display: grid;
    gap: 16px;
}

.login__fields {
    display: grid;
    gap: 6px;
}

.login__error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-left: 3px solid var(--ft-streamer);
    border-radius: var(--ft-radius-sm);
    background: rgba(200, 16, 46, 0.06);
    color: var(--ft-streamer);
    font-size: 0.9rem;
    line-height: 1.4;
}

.login__error .mud-icon-root {
    flex: none;
    margin-top: 1px;
}

.login__submit.mud-button-root {
    margin-top: 4px;
    height: 44px;
    border-radius: var(--ft-radius);
    background: linear-gradient(90deg, var(--ft-altimeter-deep), var(--ft-altimeter));
}

.login__submit.mud-button-root:hover {
    filter: brightness(1.08);
    background-color: var(--ft-altimeter-deep);
}

.login__links {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.login__actions {
    display: flex;
    gap: 12px;
}

.login__actions .mud-button-root {
    height: 48px;
}

.login__submit--grow.mud-button-root {
    flex: 1;
    margin-top: 0;
}

.login__notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-left: 3px solid var(--ft-clear);
    border-radius: var(--ft-radius-sm);
    background: rgba(46, 139, 87, 0.08);
    color: var(--ft-stencil);
    font-size: 0.9rem;
    line-height: 1.45;
}

.login__notice .mud-icon-root {
    flex: none;
    color: var(--ft-clear);
}

/* The sign-in steps as a flight strip: done steps in green, the current one in the altimeter blue. */
.login-steps {
    display: flex;
    gap: 6px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.login-steps__step {
    display: flex;
    flex: 1;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-top: 3px solid var(--ft-line);
    font-family: var(--ft-font-display);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ft-stencil-soft);
    min-width: 0;
}

.login-steps__step.is-current {
    border-top-color: var(--ft-altimeter);
    color: var(--ft-stencil);
}

.login-steps__step.is-done {
    border-top-color: var(--ft-clear);
}

.login-steps__number {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: var(--ft-radius-pill);
    background: var(--ft-chalk-deep);
    font-size: 0.72rem;
}

.login-steps__step.is-current .login-steps__number {
    background: var(--ft-altimeter);
    color: #FFFFFF;
}

.login-steps__step.is-done .login-steps__number {
    background: var(--ft-clear);
    color: #FFFFFF;
}

.login-steps__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The authenticator QR code on a white data plate, the secret below it for typing in by hand. */
.login-qr {
    display: flex;
    gap: 18px;
    align-items: center;
    min-height: 120px;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    background: #FFFFFF;
}

.login-qr__image {
    flex: none;
    width: 150px;
    height: 150px;
    image-rendering: pixelated;
}

.login-qr__manual {
    display: grid;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--ft-stencil-soft);
    min-width: 0;
}

.login-qr__secret {
    padding: 6px 10px;
    border-radius: var(--ft-radius-sm);
    background: var(--ft-chalk);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--ft-stencil);
    word-break: break-word;
}

/* The 6-digit code as one wide, spaced field (TACOM's single input, not six boxes). */
.login-code input {
    font-family: var(--ft-font-display);
    font-size: 1.6rem;
    letter-spacing: 0.5em;
    text-align: center;
}

.users__no-email {
    color: var(--ft-stencil-soft);
    font-style: italic;
}

.users__name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.users__name .people-avatar {
    width: 28px;
    height: 28px;
}

/* The picture in the user editor (UserPicturePicker): a circle that opens the file dialog, its state and the actions beside it. */
.picture-pick {
    display: flex;
    align-items: center;
    gap: 16px;
}

.picture-pick__frame {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--ft-altimeter);
    cursor: pointer;
}

.picture-pick__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picture-pick__frame.is-disabled {
    cursor: default;
    opacity: 0.7;
}

.picture-pick__initials {
    color: #FFFFFF;
    font: 700 1.6rem var(--ft-font-display);
    letter-spacing: 0.04em;
}

.picture-pick__camera {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    place-items: center;
    height: 28px;
    background: rgba(0, 0, 0, 0.45);
    color: #FFFFFF;
    opacity: 0;
    transition: opacity 0.15s;
}

.picture-pick__frame:hover .picture-pick__camera,
.picture-pick__frame:focus-within .picture-pick__camera {
    opacity: 1;
}

.picture-pick__input {
    display: none;
}

.picture-pick__side {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.picture-pick__title {
    font-weight: 600;
    color: var(--ft-stencil);
}

.picture-pick__hint {
    font-size: 0.8rem;
    color: var(--ft-stencil-soft);
}

.picture-pick__hint.is-error {
    color: var(--ft-streamer);
}

.picture-pick__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

@media (max-width: 520px) {
    .picture-pick {
        flex-direction: column;
        text-align: center;
    }

    .picture-pick__actions {
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .login-qr {
        flex-direction: column;
        text-align: center;
    }

    .login-steps__name {
        display: none;
    }
}

/* ---------- Change-password dialog ---------- */

.pw-dialog__head {
    display: flex;
    gap: 14px;
    align-items: center;
}

.pw-dialog__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--ft-radius);
    background: linear-gradient(160deg, #E6F0FA, #CFE2F7);
    color: var(--ft-altimeter-deep);
}

.pw-dialog__title {
    font-family: var(--ft-font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ft-stencil);
}

.pw-dialog__lead {
    font-size: 0.85rem;
    color: var(--ft-stencil-soft);
}

.pw-dialog__form {
    display: grid;
    gap: 10px;
    padding-top: 4px;
}

.pw-dialog__divider {
    height: 1px;
    margin: 6px 0;
    background: var(--ft-line);
}

.pw-rules {
    display: grid;
    gap: 6px;
    margin: 4px 0 0;
    padding: 12px 14px;
    list-style: none;
    border-radius: var(--ft-radius-sm);
    background: var(--ft-chalk);
}

.pw-rules__item {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--ft-stencil-soft);
    transition: color 0.15s ease;
}

.pw-rules__item.is-met {
    color: var(--ft-clear);
}

/* ---------- Language switch ---------- */

.lang {
    display: flex;
    gap: 2px;
}

.lang__btn {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font: 600 0.8rem var(--ft-font-display);
    letter-spacing: 0.04em;
    color: var(--ft-stencil-soft);
    cursor: pointer;
}

.lang__btn:hover {
    color: var(--ft-stencil);
}

.lang__btn[aria-pressed="true"] {
    color: var(--ft-stencil);
    border-bottom-color: var(--ft-altimeter);
}

.lang__btn:focus-visible {
    outline: 2px solid var(--ft-altimeter);
    outline-offset: 2px;
}

.lang--dark .lang__btn {
    color: rgba(255, 255, 255, 0.6);
}

.lang--dark .lang__btn:hover,
.lang--dark .lang__btn[aria-pressed="true"] {
    color: #FFFFFF;
}

.lang--dark .lang__btn[aria-pressed="true"] {
    border-bottom-color: var(--ft-caution);
}

/* ---------- Horizon panel (login signature) ---------- */

.horizon {
    position: absolute;
    inset: 0;
}

.horizon__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.horizon__attitude {
    transform-origin: 400px 520px;
    animation: ft-level 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.horizon__sky {
    fill: var(--ft-sky);
}

.horizon__ground {
    fill: var(--ft-apron);
}

.horizon__line {
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 2;
}

.horizon__ladder line {
    stroke: rgba(255, 255, 255, 0.45);
    stroke-width: 2;
}

.horizon__ladder .horizon__ladder-below {
    stroke-dasharray: 18 12;
}

.horizon__ladder text {
    font-family: var(--ft-font-display);
    font-size: 22px;
    fill: rgba(255, 255, 255, 0.5);
}

.horizon__aircraft path {
    fill: none;
    stroke: var(--ft-caution);
    stroke-width: 5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.horizon__aircraft circle {
    fill: var(--ft-caution);
}

.horizon__brand {
    position: absolute;
    left: 56px;
    top: 44px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 420px;
}

.horizon__tagline {
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.7);
}

/* ---------- Horizon rule (page title ornament) ---------- */

.ft-rule {
    display: flex;
    align-items: center;
    height: 12px;
    margin: 8px 0 12px;
    color: var(--ft-caution);
}

.ft-rule__line {
    flex: 0 0 48px;
    height: 1px;
    background: var(--ft-stencil-soft);
    opacity: 0.45;
}

.ft-rule__symbol {
    flex: none;
    width: 44px;
    height: 12px;
    margin: 0 2px;
}

.ft-rule__tail {
    flex: 0 0 112px;
    height: 1px;
    background: var(--ft-stencil-soft);
    opacity: 0.45;
}

/* ---------- Shell: content ---------- */

/* Centred on wide screens, like the top bar's wordmark; wide enough for the lists' columns. */
.ft-page {
    padding: 32px 40px 56px;
    max-width: 1600px;
    margin: 0 auto;
}

/* A page with a list takes the whole width: wide lists need the columns more than the margins. Forms stay centred. */
.ft-page:has(.lt) {
    max-width: none;
}

/* A form page keeps the form's width even when a panel inside it holds a list: the header and the cards line up, centred. */
.ft-page:has(.editor) {
    max-width: calc(var(--ft-editor-width) + 80px);
}

.ft-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 16px;
}

.ft-toolbar__wide {
    width: min(100%, 420px);
}

.ft-empty {
    margin: 24px 0;
    color: var(--ft-stencil-soft);
}

/* ---------- Tables ---------- */

.ft-grid.mud-table {
    background: #FFFFFF;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    overflow: hidden;
    box-shadow: var(--ft-shadow-soft);
}

.ft-grid .mud-table-container {
    border-radius: inherit;
}

.ft-grid .mud-table-pagination {
    border-top: 1px solid var(--ft-line);
    background: #FBFCFD;
}

.ft-grid .mud-table-row.is-selected > td {
    background: rgba(47, 127, 184, 0.08);
}

.ft-grid .mud-table-row.is-selected > td:first-child {
    box-shadow: inset 3px 0 0 var(--ft-caution);
}

.ft-grid--narrow.mud-table {
    max-width: 980px;
}

.ft-grid .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ft-grid .mud-table-head th {
    background: #EEF2F6;
    font-family: var(--ft-font-display);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--ft-stencil);
    white-space: nowrap;
}

.ft-grid .mud-table-head th .mud-table-sort-label {
    font-family: inherit;
}

.ft-grid .mud-table-cell {
    border-bottom: 1px solid var(--ft-line);
}

.ft-grid .mud-table-row:last-child .mud-table-cell {
    border-bottom: 0;
}

.ft-grid__actions {
    text-align: right;
    white-space: nowrap;
}

.ft-grid__actions .mud-icon-button {
    color: var(--ft-stencil-soft);
}

.ft-grid__actions .mud-icon-button:hover {
    color: var(--ft-altimeter-deep);
}

.ft-grid__row--muted {
    color: var(--ft-stencil-soft);
}

/* ---------- Forms ---------- */

.ft-form {
    display: grid;
    gap: 14px;
}

.ft-form--narrow {
    max-width: 420px;
}

.ft-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ft-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.ft-fieldset {
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    padding: 10px 14px 6px;
    margin: 0;
}

.ft-fieldset legend {
    padding: 0 6px;
    font-size: 0.85rem;
    color: var(--ft-stencil-soft);
}

.ft-fieldset__hint {
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: var(--ft-stencil-soft);
}

.ft-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
}

/* An interval row's tolerance with its "Standart: N" button under it (IntervalLimitFields), one grid cell. */
.interval-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.interval-field > .mud-input-control {
    width: 100%;
}

.interval-field__standard {
    margin-top: -2px;
    text-transform: none;
}

/* ---------- Split layout (roles) ---------- */

.ft-split {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.ft-side-add {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.ft-side-add .mud-input-control {
    flex: 1;
}

.ft-side-list {
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    background: #FFFFFF;
    max-height: 60vh;
    overflow: auto;
}

.ft-side-list .mud-selected-item {
    border-left: 3px solid var(--ft-caution);
    background: rgba(47, 127, 184, 0.08) !important;
}

.ft-select--compact {
    width: 200px;
}

/* MudSelect wraps its input in a growing .mud-select; let the toolbar size it by the input instead. */
.ft-toolbar > .mud-select {
    flex: none;
    width: auto;
}

/* ---------- Home: cards (ft3mweb HomeHub) ---------- */

/*
 * Cards of one width, three to a row (two on a narrow window, one on a phone); a last row that is not full is centred.
 * Each card spans two tracks, so a short row can start half a card in. Any card component's root element takes part (HomeCard.Component).
 */
.hub {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.hub > * {
    grid-column: span 2;
}

.hub > *:nth-child(3n+1):nth-last-child(2) {
    grid-column: 2 / span 2;
}

.hub > *:nth-child(3n+1):last-child {
    grid-column: 3 / span 2;
}

@media (max-width: 1100px) {
    .hub {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hub > *:nth-child(3n+1):nth-last-child(2),
    .hub > *:nth-child(3n+1):last-child {
        grid-column: span 2;
    }

    .hub > *:nth-child(odd):last-child {
        grid-column: 2 / span 2;
    }
}

@media (max-width: 640px) {
    .hub {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub > *,
    .hub > *:nth-child(3n+1):nth-last-child(2),
    .hub > *:nth-child(3n+1):last-child,
    .hub > *:nth-child(odd):last-child {
        grid-column: auto;
    }
}

/* Every card hidden: the empty state says where they come back and offers them all at once. */
.home-empty__hint {
    margin: 0 0 8px;
    font-size: 0.85rem;
}

.hub-tile {
    --hub-accent: var(--ft-altimeter);
    --hub-accent-deep: var(--ft-altimeter-deep);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px 22px;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-lg);
    box-shadow: var(--ft-shadow-soft);
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

/* The accent along the bottom edge, shown on hover and focus. */
.hub-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hub-accent), var(--hub-accent-deep));
    opacity: 0;
    transition: opacity 160ms ease;
}

.hub-tile:hover {
    transform: translateY(-3px);
    border-color: var(--hub-accent);
    box-shadow: var(--ft-shadow-raised);
}

.hub-tile:hover::after,
.hub-tile:focus-visible::after {
    opacity: 1;
}

.hub-tile:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 2px;
}

.hub-tile__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.hub-tile__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--ft-radius);
    background: linear-gradient(135deg, var(--hub-accent), var(--hub-accent-deep));
    color: #FFFFFF;
    box-shadow: 0 8px 16px -8px var(--hub-accent-deep);
    transition: transform 160ms ease;
}

.hub-tile__icon .mud-icon-root {
    font-size: 1.75rem;
}

.hub-tile:hover .hub-tile__icon {
    transform: scale(1.05);
}

.hub-tile__title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-family: var(--ft-font-display);
    font-weight: 600;
    font-size: 1.22rem;
    line-height: 1.25;
    color: var(--ft-sky);
}

.hub-tile__desc {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--ft-stencil-soft);
}

/* The arrow after the title: faint at rest, in the accent and a step forward on hover. */
.hub-tile__go.mud-icon-root {
    color: var(--ft-line);
    transition: transform 160ms ease, color 160ms ease;
}

.hub-tile:hover .hub-tile__go.mud-icon-root,
.hub-tile:focus-visible .hub-tile__go.mud-icon-root {
    color: var(--hub-accent-deep);
    transform: translateX(3px);
}

/* The count as the card's readout: the number large in the tone of its state (the StatusBadge tones), what it counts under it. */
.hub-readout {
    --badge-fg: var(--ft-stencil-soft);
    --badge-dot: #9AA4B0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 0;
    text-align: right;
}

.hub-readout__value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 700 2.1rem/1 var(--ft-font-display);
    font-variant-numeric: tabular-nums;
    color: var(--badge-fg);
}

.hub-readout__value .badge__dot {
    width: 9px;
    height: 9px;
}

.hub-readout__label {
    max-width: 26ch;
    font-size: 0.8rem;
    line-height: 1.25;
    color: var(--ft-stencil-soft);
}

.hub-tile--sky {
    --hub-accent: #3E8FD0;
    --hub-accent-deep: var(--ft-sky);
}

.hub-tile--streamer {
    --hub-accent: #E0475E;
    --hub-accent-deep: var(--ft-streamer);
}

.hub-tile--caution {
    --hub-accent: var(--ft-caution);
    --hub-accent-deep: #9C7015;
}

/* The flights' colour, as their lane on the main system timeline. */
.hub-tile--teal {
    --hub-accent: #1F9AA8;
    --hub-accent-deep: #146B75;
}

/* Calibration: the maintenance violet of the status board. */
.hub-tile--violet {
    --hub-accent: #8E70C8;
    --hub-accent-deep: #5E4596;
}

/* Quantity warnings: a stock copper, apart from the caution amber of the bulletins. */
.hub-tile--copper {
    --hub-accent: #C9773A;
    --hub-accent-deep: #8A4A1C;
}

.hub-tile--clear {
    --hub-accent: #45A872;
    --hub-accent-deep: #23704A;
}

.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 24px;
    margin: 0;
}

.facts dt {
    color: var(--ft-stencil-soft);
}

.facts dd {
    margin: 0;
}

/* ---------- Motion ---------- */

@keyframes ft-level {
    from {
        transform: rotate(-5deg) translateY(28px);
    }

    to {
        transform: rotate(0deg) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .horizon__attitude {
        animation: none;
    }

    .hub-tile,
    .hub-tile::after,
    .hub-tile__icon,
    .hub-tile__go.mud-icon-root {
        transition: none;
    }
}

/* ---------- Narrow windows ---------- */

@media (max-width: 900px) {
    .login {
        align-items: start;
        padding: 12px;
    }

    .login__card {
        grid-template-columns: 1fr;
        min-height: 0;
        border-radius: var(--ft-radius-lg);
    }

    .login__brand {
        flex-direction: row;
        gap: 14px;
        padding: 18px 20px;
        text-align: left;
    }

    .login__emblem {
        width: 56px;
        height: 56px;
        margin: 0;
    }

    .login__emblem svg {
        width: 36px;
    }

    .login__wordmark {
        font-size: 1.7rem;
    }

    .login__tagline,
    .login__pill {
        display: none;
    }

    .login__panel {
        padding: 16px 20px;
    }

    .ft-wordmark {
        font-size: 3.5rem;
    }

    .horizon__brand {
        left: 24px;
        top: 16px;
        gap: 6px;
    }

    .horizon__tagline {
        display: none;
    }

    .ft-page {
        padding: 20px 16px 40px;
    }

    .ft-form__row,
    .ft-split {
        grid-template-columns: 1fr;
    }
}

/* ---------- Update history (UpdateHistoryPanel): one line per update, opened into field / before / after ---------- */

.hist {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hist__entry {
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-sm);
    background: #FFFFFF;
}

.hist__entry.is-open {
    border-color: var(--ft-altimeter);
}

.hist__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 4px 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--ft-radius-sm);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hist__head:focus-visible {
    outline: 2px solid var(--ft-altimeter);
    outline-offset: 2px;
}

.hist__date {
    font-family: var(--ft-font-display);
    font-weight: 600;
    white-space: nowrap;
}

.hist__user {
    overflow: hidden;
    color: var(--ft-stencil-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hist__chevron {
    color: var(--ft-stencil-soft);
}

.hist__body {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
}

.hist__none {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ft-stencil-soft);
}

.hist__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.85rem;
}

.hist__table th,
.hist__table td {
    padding: 6px 8px;
    border-top: 1px solid var(--ft-line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.hist__table thead th {
    border-top: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ft-stencil-soft);
}

.hist__table th[scope="row"] {
    width: 30%;
    font-weight: 600;
}

/* A changed field: the caution tint with a stripe, the new value in bold (the legacy grid painted the row red). */
.hist__table tr.is-changed {
    background: #FDF6E3;
}

.hist__table tr.is-changed th[scope="row"] {
    box-shadow: inset 3px 0 0 var(--ft-caution);
}

.hist__table tr.is-changed td:last-child {
    font-weight: 600;
}

@media (max-width: 600px) {
    .hist__head {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hist__date { grid-area: 1 / 1; }
    .hist__chevron { grid-area: 1 / 2; }
    .hist__user { grid-area: 2 / 1; }
    .hist__head .badge { grid-area: 2 / 2; }

    .hist__table thead {
        display: none;
    }

    .hist__table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-top: 1px solid var(--ft-line);
    }

    .hist__table th,
    .hist__table td {
        border-top: 0;
    }

    .hist__table th[scope="row"] {
        grid-column: 1 / -1;
        width: auto;
        padding-bottom: 0;
    }

    .hist__table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 400;
        text-transform: uppercase;
        color: var(--ft-stencil-soft);
    }
}

/* DialogLink: looks like the app's links (text colour, no underline) and flows with the text, but opens a read-only dialog. */
.dialog-link {
    color: inherit;
    cursor: pointer;
}

.dialog-link:hover {
    text-decoration: underline;
}

.dialog-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Tooltips (js/tooltips.js shows every title this way): a light FT3M card with the altimeter accent, instead of the browser's black box. */
.ft-tip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    max-width: min(340px, calc(100vw - 16px));
    padding: 7px 11px 7px 12px;
    background: #FFFFFF;
    color: var(--ft-stencil);
    border: 1px solid var(--ft-line);
    border-left: 3px solid var(--ft-altimeter);
    border-radius: var(--ft-radius-sm);
    box-shadow: var(--ft-shadow-raised);
    font: 500 0.8125rem/1.45 var(--ft-font-body);
    white-space: pre-line;
    overflow-wrap: anywhere;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}

.ft-tip--shown {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.ft-tip--below {
    transform: translateY(-3px);
}

.ft-tip--below.ft-tip--shown {
    transform: none;
}

/* The arrow points at the element: under the tooltip, or over it when the tooltip sits below. */
.ft-tip::after {
    content: "";
    position: absolute;
    left: var(--ft-tip-arrow, 50%);
    bottom: -5.5px;
    width: 9px;
    height: 9px;
    background: inherit;
    border: solid var(--ft-line);
    border-width: 0 1px 1px 0;
    transform: translateX(-50%) rotate(45deg);
}

.ft-tip--below::after {
    top: -5.5px;
    bottom: auto;
    border-width: 1px 0 0 1px;
}

@media (prefers-reduced-motion: reduce) {
    .ft-tip {
        transition: none;
    }
}

/* Change log (audit): the facts above a change's field table, and the summary cell of the list. */
.cl-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px 16px;
    margin: 0 0 14px;
}

.cl-facts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ft-stencil-soft);
}

.cl-facts dd {
    margin: 2px 0 0;
    font-size: 0.9rem;
}

.cl-facts__raw {
    font-size: 0.8rem;
    color: var(--ft-stencil-soft);
}

.cl-summary {
    color: var(--ft-stencil-soft);
    white-space: nowrap;
}

/* Work order timeline (event log): a vertical line of dots, one per event, with who/when under the title. */
.wo-tl__head {
    justify-content: space-between;
    gap: 12px;
}

.wo-tl__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.wo-tl__toggle h2 {
    margin: 0;
}

.wo-tl__count {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--ft-altimeter);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
}

.wo-tl__list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0 0 0 18px;
    border-left: 2px solid var(--ft-line);
}

.wo-tl__item {
    position: relative;
    padding: 0 0 14px 14px;
}

.wo-tl__dot {
    position: absolute;
    left: -24px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--ft-clear);
    background: var(--ft-altimeter);
}

.wo-tl__item--transferred .wo-tl__dot { background: var(--ft-caution); }
.wo-tl__item--reopened .wo-tl__dot { background: var(--ft-streamer); }

.wo-tl__what {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
    font-size: 0.9rem;
}

.wo-tl__detail {
    color: var(--ft-stencil-soft);
    font-size: 0.85rem;
}

.wo-tl__meta {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--ft-stencil-soft);
}

.wo-tl__note {
    margin: 6px 0 0;
    padding: 6px 10px;
    border-radius: var(--ft-radius-sm);
    background: color-mix(in srgb, var(--ft-line) 40%, transparent);
    font-size: 0.85rem;
    white-space: pre-line;
}

/* Main system status on a board card: since when. */
.msb-card__status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.msb-card__since {
    font-size: 0.75rem;
    color: var(--ft-stencil-soft);
}

/* ExpandableText: a long free text cut to three lines until opened. */
.xt__text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.xt--open .xt__text {
    display: block;
}

.xt__toggle {
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ft-altimeter-deep);
    font: 600 0.82rem var(--ft-font-display);
    cursor: pointer;
}

.xt__toggle:hover,
.xt__toggle:focus-visible {
    text-decoration: underline;
}
