/*
 * UILTRASPORTI / FLIGHTDECK
 * Shared application skin. Loaded last; feature sheets own layout and state.
 * No selectors in this sheet change visibility of functional panels.
 */
:root {
    color-scheme: light;
    --fd-ink: #193b4b;
    --fd-night: #102e3c;
    --fd-muted: #526e79;
    --fd-accent: #175c70;
    --fd-amber: #d5ad62;
    --fd-ground: #eaf0ef;
    --fd-paper: #fafbf7;
    --fd-soft: #e0eae8;
    --fd-line: #cbd9d9;
    --fd-font: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    --fd-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --primary-color: var(--fd-accent);
    --secondary-color: var(--fd-muted);
    --bg-color: var(--fd-ground);
    --card-bg: var(--fd-paper);
    --text-color: var(--fd-ink);
    --border-color: var(--fd-line);
}
html { scroll-padding-top: 125px; }
body, .ma-page { min-height: 100dvh; background: var(--fd-ground); color: var(--fd-ink); font-family: var(--fd-font); line-height: 1.55; }
body { background-image: linear-gradient(90deg, #47748005 1px, transparent 1px); background-size: 80px 80px; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--fd-accent); text-underline-offset: 4px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b48130; outline-offset: 4px; }
::selection { background: #d8e9df; color: #123848; }
h1, h2, h3, h4 { text-wrap: balance; }
.navbar {
    background: var(--fd-night); border-bottom: 3px solid var(--fd-amber);
    box-shadow: 0 5px 22px #153a4810; backdrop-filter: none;
}
.nav-container { max-width: 1600px; padding: 14px 28px; gap: 24px; }
.nav-brand { flex-shrink: 0; }
.nav-brand-row { flex-direction: row; gap: 15px; }
.nav-brand-link { flex-direction: row; padding: 4px 9px; background: #153747; border-radius: 4px; }
.nav-brand-logo { max-width: 158px; max-height: 48px; object-fit: contain; }
.nav-brand h2 { color: #f4f7ed; font-size: 1.02rem; text-shadow: none; max-width: 190px; }
.nav-subtitle { color: #b8cdd0; text-shadow: none; font: .63rem var(--fd-mono); letter-spacing: .09em; }
.company-selector-brand, .current-company-badge-brand {
    background: #244654; border: 1px solid #4b6873; color: #e9f1e9;
    margin-top: 0; border-radius: 3px; padding: 6px 8px; font: .68rem var(--fd-mono);
}
.company-selector-wrapper-brand { margin-top: 0; }
.nav-links { gap: 2px; }
.nav-menu { background: var(--fd-night); }
.nav-link, .nav-user-top .nav-link {
    font-size: .79rem; font-weight: 600; letter-spacing: 0; padding: 10px 11px;
    margin: 0; border-radius: 3px; color: #c1d5d7; transition: transform .18s, opacity .18s;
}
.nav-link:hover, .nav-link.active { background: #294c59; color: #f7f8ed !important; transform: none; }
.nav-link::before { background: var(--fd-amber); width: 2px; }
.nav-user-top { background: transparent; padding: 0 0 0 14px; border-left: 1px solid #46616a; border-bottom: 0; gap: 3px; }
.nav-user-top .nav-link { background: transparent; border: 0; }
.nav-icon { width: 20px; display: inline-flex; align-items: center; justify-content: center; filter: none; }
.nav-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.burger-menu { background: #244654; border: 1px solid #486674; border-radius: 4px; }
.burger-menu span { height: 2px; background: #dfece8; }
.main-content { width: 100%; max-width: 1512px; margin: 0 auto; padding: 32px clamp(16px, 3.5vw, 56px) 54px; min-height: calc(100dvh - 190px); }
.page-header { padding: 8px 0 23px; margin-bottom: 25px; border-bottom: 1px solid #b7caca; }
.page-header h1, .ma-page h1 { font-size: clamp(1.85rem, 3.4vw, 2.9rem); line-height: 1.12; letter-spacing: -.045em; font-weight: 700; color: var(--fd-ink); }
.page-header h1::before { content: ""; display: inline-block; width: 8px; height: .78em; background: var(--fd-amber); margin-right: 14px; }
.workspace-greeting { color: #537680; font: .7rem var(--fd-mono); letter-spacing: .06em; margin-bottom: 14px; transition: opacity .5s; }
.workspace-period { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; font-size: .8rem; }
.workspace-period label { font-weight: 650; color: var(--fd-muted); }
.workspace-period select { background: var(--fd-paper); border: 1px solid #b8cdce; border-radius: 4px; padding: 9px 12px; min-height: 44px; color: var(--fd-ink); max-width: 100%; font-size: .85rem; }
.subtitle { color: var(--fd-muted); font-size: .96rem; margin-top: 9px; }
.card, .ma-panel {
    border: 1px solid var(--fd-line); border-radius: 8px; background: var(--fd-paper);
    padding: clamp(18px, 2.4vw, 30px); box-shadow: 0 3px 14px #173d4b05;
}
.card:hover { transform: none; box-shadow: 0 3px 14px #173d4b05; }
.card h3, .ma-panel h2 { font-size: 1.12rem; letter-spacing: -.025em; color: var(--fd-ink); }
.card h3 { padding-bottom: 14px; border-bottom: 1px solid var(--fd-line); }
.dashboard-grid { gap: 18px; }
.dashboard-grid > .card { min-width: 0; }
.dashboard-metric { order: -3; border-top: 3px solid #71908f; margin-bottom: 0; }
.dashboard-number { color: var(--fd-ink); font: 600 clamp(2.5rem, 4vw, 3.4rem)/1.2 var(--fd-mono); letter-spacing: -.08em; }
.dashboard-metric > div { padding: 14px 0 !important; text-align: left !important; }
.dashboard-metric > div > div:not(.dashboard-number) { font-size: .8rem !important; }
.dashboard-metric--primary { background: var(--fd-night); border-color: var(--fd-night); border-top-color: var(--fd-amber); }
.dashboard-metric--primary h3, .dashboard-metric--primary .dashboard-number { color: #f0f3e7; }
.dashboard-metric--primary h3 { border-color: #45616b; }
.dashboard-metric--primary > div > div:not(.dashboard-number) { color: #b7cdce !important; }
.dashboard-metric--amber { border-top-color: var(--fd-amber); }
.dashboard-map { order: -4; grid-column: 1 / -1; }
.dashboard-trend { order: -1; }
.kpi-grid { gap: 10px; }
.kpi-card {
    text-align: left; border-radius: 5px; border: 1px solid var(--fd-line); border-top: 3px solid #547b85;
    padding: 18px 20px; box-shadow: none; background: var(--fd-paper);
}
.kpi-value { color: var(--fd-ink); font: 600 clamp(1.7rem, 2.8vw, 2.45rem)/1.2 var(--fd-mono); letter-spacing: -.065em; margin-bottom: 10px; }
.kpi-label { font-size: .74rem; color: var(--fd-muted); font-weight: 600; }
.kpi-card:first-child { background: var(--fd-night); border-color: var(--fd-night); border-top-color: var(--fd-amber); }
.kpi-card:first-child .kpi-value { color: #f2f4e9; }
.kpi-card:first-child .kpi-label { color: #c1d4d2; }
.btn, .btn-export, .ma-button, .sv-btn, .re-btn {
    min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 4px;
    font-size: .88rem; font-weight: 700; line-height: 1.4; box-shadow: none;
    transition: transform .18s, opacity .18s; white-space: normal;
}
.btn:hover, .btn-export:hover, .ma-button:hover { box-shadow: none; transform: translateY(-1px); filter: none; }
.btn:disabled, .ma-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary, .btn-export, .ma-button { background: var(--fd-accent); color: #f7f8ef; border-color: var(--fd-accent); }
.ma-page a.ma-button:not(.ma-secondary):not(.ma-danger) { color: #f7f8ef; }
.btn-primary:hover, .btn-export:hover { background: #214d5d; }
.btn-secondary, .ma-secondary { background: #e7eeea; color: var(--fd-ink); border-color: #bdcecf; }
.btn-secondary:hover { background: #d7e3df; color: var(--fd-ink); }
.btn-danger, .ma-danger { color: #923d44; background: #f8e9e7; border-color: #dcb8b5; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: .8rem; }
.form-group label, .ma-field label { font-size: .82rem; font-weight: 700; color: var(--fd-ink); }
.form-group input:not([type=checkbox]):not([type=radio]), .form-group select, .form-group textarea,
.filters input, .filters select, .search-box input, .ma-page input:not([type=checkbox]), .ma-page select {
    min-height: 46px; padding: 11px 13px; border: 1px solid #b8cdce; border-radius: 4px;
    background: #f5f8f3; color: var(--fd-ink); font-size: .94rem;
}
input::placeholder, textarea::placeholder { color: #657f87; opacity: 1; }
.form-group input:not([type=checkbox]):not([type=radio]):focus, .form-group select:focus, .form-group textarea:focus,
.ma-field input:focus, .ma-field select:focus { border-color: #367d87; outline: 2px solid #367d8733; outline-offset: 1px; }
input[type=checkbox], input[type=radio] { accent-color: var(--fd-accent); }
.form-group small { color: var(--fd-muted); font-size: .78rem; line-height: 1.5; }
.filters { padding: 16px; background: var(--fd-soft); border: 1px solid var(--fd-line); border-radius: 5px; gap: 12px; flex-wrap: wrap; }
.filters input, .filters select { margin-bottom: 0; }
.filters > * { min-width: 0; flex: 1 1 160px; }
.filters > .btn-export { flex: 0 1 auto; }
.search-box { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.search-box input { margin-bottom: 0; flex: 1; min-width: 0; }
.search-box .btn { width: auto; flex-shrink: 0; }
.table-container { margin: 0; padding: 0; border: 1px solid var(--fd-line); border-radius: 5px; }
table { font-size: .86rem; }
th, .ma-page th { background: #e3ebe7; color: #42616d; font: 600 .68rem/1.5 var(--fd-mono); text-transform: uppercase; letter-spacing: .055em; border-bottom: 1px solid #bdcecc; padding: 13px 15px; }
td, .ma-page td { padding: 13px 15px; border-bottom: 1px solid #dbe5df; vertical-align: middle; }
tbody tr:nth-child(even) { background: #eaf0e926; }
tbody tr:hover { background: #e5eee9; }
.status-badge, .ma-badge { border-radius: 3px; padding: 4px 8px; font-size: .7rem; letter-spacing: .025em; }
.contact-status { border-radius: 4px; }
.modal { background: #0c293bc2; backdrop-filter: blur(4px); }
.modal-content, .ma-page dialog { background: var(--fd-paper); border: 1px solid #b9cece; border-radius: 8px; box-shadow: 0 28px 80px #0d293c38; max-height: 90dvh; }
.modal-header, .modal-header-simple { background: #edf2eb; border-color: var(--fd-line); }
.modal-header h3 { color: var(--fd-ink); }
.flash-message, .ma-status { border-radius: 4px; font-size: .9rem; }
.flash-info, .ma-status { background: #e0eceb; border-color: #abc9cd; color: #254f60; }
.flash-error, .ma-status[data-kind=error] { background: #f7e8e5; color: #8d353f; border-color: #d8b5af; }
.flash-success, .ma-status[data-kind=success] { background: #e1efe5; color: #235d4f; border-color: #a7c8b5; }
.loading { color: var(--fd-muted); }
.ma-empty { background: #eaf0e8; border-color: #a5bfbf; padding: 38px 22px; border-radius: 5px; }
.ma-empty::before { content: "— / —"; display: block; font: 1.4rem var(--fd-mono); color: #78989c; margin-bottom: 14px; }
.ma-skeleton { background: #ccded8; border-radius: 5px; }
.app-footer { border-top: 1px solid var(--fd-line); padding: 24px 30px; color: var(--fd-muted); background: #e3ebe7; font-size: .78rem; display: flex; justify-content: space-between; gap: 15px; }
.app-footer a { color: var(--fd-accent); }
.app-footer__version { font-family: var(--fd-mono); font-size: .68rem; }
.app-version { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 5px 9px; border: 1px solid var(--fd-line); border-radius: 4px; background: var(--fd-paper); color: var(--fd-ink); font: .72rem/1.5 var(--fd-mono); }
.app-version__label { color: var(--fd-muted); }
/* Member workspace */
.ma-header { background: var(--fd-night); border-bottom: 3px solid var(--fd-amber); color: #edf3e9; padding: 20px max(20px, calc((100% - 1320px)/2)); }
.ma-brand img { background: #153747; padding: 5px 8px; border-radius: 3px; }
.ma-brand strong { font-size: .94rem; letter-spacing: -.015em; }
.ma-header .ma-eyebrow { color: #b7cdd0; margin-top: 4px; display: block; font: .64rem var(--fd-mono); letter-spacing: .1em; }
.ma-header > a { color: #e1ebde; font-size: .78rem; }
.ma-header .ma-secondary { background: transparent; color: #edf3e9; border-color: #69838a; }
.ma-main { max-width: 1320px; width: calc(100% - 64px); margin: 38px auto 60px; }
.ma-intro { max-width: 850px; border-bottom: 1px solid #b8ceca; padding-bottom: 23px; margin-bottom: 26px; }
.ma-intro p { margin-bottom: 0; font-size: .94rem; }
.ma-eyebrow { font: 600 .68rem var(--fd-mono); color: #56717b; letter-spacing: .1em; }
.ma-nav { padding: 5px; gap: 4px; background: #dfe9e4; border: 1px solid #c3d5d1; border-radius: 5px; margin-bottom: 25px; }
.ma-nav button { border-radius: 3px; font-weight: 650; font-size: .86rem; padding: 11px 20px; }
.ma-nav button[aria-current=page] { background: var(--fd-night); color: #edf3e9; box-shadow: inset 0 -2px var(--fd-amber); }
.ma-note { background: #e6eeea; border-left: 2px solid #7b9e9c; font-size: .85rem; border-radius: 0 4px 4px 0; }
.ma-definition { gap: 20px 35px; }
.ma-definition > div { border-bottom: 1px solid var(--fd-line); padding-bottom: 15px; }
.ma-definition dt { font: .69rem var(--fd-mono); text-transform: uppercase; letter-spacing: .06em; }
.ma-definition dd { font-size: 1rem; margin-top: 8px; }
.ma-toolbar { background: #e6eee8; padding: 20px; border-radius: 5px; }
.ma-toolbar .ma-field { margin-bottom: 0; }
.ma-footer { max-width: 1320px; border-color: var(--fd-line); font-size: .73rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* Stable communication rail: all four pages share these exact dimensions. */
.communication-page, .re-page, .sv { width: 100%; max-width: 1200px; padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; }
.communication-nav {
    --comm-ink: var(--fd-ink); --comm-muted: var(--fd-muted); --comm-line: var(--fd-line);
    background: #dce7e3; border: 1px solid #b9cfca; border-bottom: 1px solid #b9cfca; border-radius: 6px;
    font-family: var(--fd-font); padding: 5px; margin: 0 0 24px;
}
.communication-nav .communication-nav__item { min-height: 49px; border-radius: 3px; font-size: .86rem; padding: 9px 11px; color: #466570; }
.communication-nav .communication-nav__item.is-active { background: var(--fd-night); color: #edf3e9; border-color: var(--fd-night); box-shadow: inset 0 -2px var(--fd-amber); }
.communication-subnav { border-bottom-color: #b8ceca; }
.communication-subnav .communication-nav__item { color: #56717b; }
.communication-subnav .communication-nav__item.is-active { border-bottom-color: #a17a36; color: var(--fd-ink); }
.communication-personalization { padding: 17px 20px; border-left: 2px solid #92aba7; border-radius: 0 4px 4px 0; background: #e8efea; margin-bottom: 24px; }
.communication-personalization strong { color: var(--fd-ink); font-size: .9rem; }
.ai-comm-assistant-panel { background: #e7eeea; border: 1px solid #b4cfcd; border-radius: 5px; padding: 20px; margin-bottom: 20px; }
.ai-comm-assistant-panel h4 { color: #2a5969; font-size: .92rem; }
#editor-container { background: var(--fd-paper); border-color: var(--fd-line); }
#editor-container .ql-editor { color: var(--fd-ink); font-family: var(--fd-font); }
.ql-toolbar.ql-snow { background: #e8efea; border-color: #bdcece; }
.ql-container.ql-snow { border-color: #bdcece; }
.sv .communication-nav, .re-page .communication-nav { margin-bottom: 24px; }
.sv, .sv-public {
    --sv-ink: var(--fd-ink); --sv-red: #a03d4b; --sv-paper: var(--fd-ground); --sv-surface: var(--fd-paper);
    --sv-line: var(--fd-line); --sv-muted: var(--fd-muted); --sv-soft: var(--fd-soft); font-family: var(--fd-font);
}
.sv h1, .sv h2 { font-family: var(--fd-font); font-weight: 700; }
.sv-head { padding: 9px 0 26px; }
.sv-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.sv-card { border-radius: 5px; padding: 22px; border-left-width: 3px; box-shadow: none; }
.sv-card h2 { font-size: 1.2rem; }
.sv-btn { border-radius: 4px; }
.re-page {
    --re-ink: var(--fd-ink); --re-muted: var(--fd-muted); --re-line: var(--fd-line);
    --re-paper: var(--fd-paper); --re-tint: var(--fd-soft); --re-surface: var(--fd-paper); font-family: var(--fd-font);
}
.re-page .re-panel { border-radius: 6px; padding: 25px; }
.re-page .re-stats { border-radius: 5px; }
.re-page .re-stat strong { font-family: var(--fd-mono); letter-spacing: -.06em; font-weight: 600; }
.re-page .re-section-picker { background: #e1eae4; border-radius: 5px; flex-wrap: wrap; }
.re-page .re-section-picker__button { border-radius: 3px; font-size: .8rem; min-height: 44px; }
.re-page .re-section-picker__button.is-active { background: #315c67; color: #f1f5e8; }
.re-page .re-empty { background: #eaf0e8; border: 1px dashed #a5bfbf; border-radius: 5px; }
.re-page h1, .re-page h2, .delegation-admin h1, .delegation-admin h2 { font-family: var(--fd-font); letter-spacing: -.035em; }
.re-page h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.delegation-admin { --ink: var(--fd-ink); --muted: var(--fd-muted); --line: var(--fd-line); font-family: var(--fd-font); }
.delegation-admin .delegation-button { border-radius: 4px; font-family: var(--fd-font); }
.delegation-admin .delegation-admin-toolbar { padding: 22px; background: #e1eae4; border: 1px solid var(--fd-line); border-radius: 5px; margin: 22px 0; }
.delegation-admin .delegation-admin-header { padding-top: 8px; }
.delegation-admin h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.delegation-referrals__state { border-radius: 5px; background: #eaf0e8; border-color: #a5bfbf; }
/* Login: simulated airspace, one compact form. */
.radar-backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #102e3c; }
.radar-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #102e3c00, #102e3c25 60%, #102e3c66); }
#airspace-radar { display: block; width: 100%; height: 100%; }
.radar-caption { position: fixed; bottom: 23px; left: 28px; z-index: 1; pointer-events: none; color: #95b8ba; font: .61rem var(--fd-mono); letter-spacing: .11em; text-transform: uppercase; }
.radar-caption::before { content: ""; display: inline-block; width: 6px; height: 6px; border: 1px solid #d0b16f; margin-right: 9px; }
.ma-page[data-page=login], body.login-page { background: #102e3c; position: relative; min-height: 100dvh; overflow-x: hidden; }
.ma-page[data-page=login] .ma-main { width: 100%; min-height: 100dvh; margin: 0; padding: 45px 20px; display: grid; place-items: center; position: relative; z-index: 2; }
.ma-page[data-page=login] .ma-auth { display: block; width: 100%; max-width: 420px; margin: 0; }
.ma-page[data-page=login] .ma-panel, .login-page .login-card {
    background: #f6f8f0; border: 1px solid #d3ded0; border-radius: 8px;
    border-top: 3px solid var(--fd-amber); padding: 32px; box-shadow: 0 24px 90px #061d3366;
}
.auth-brand { background: #153747; border-radius: 4px; display: flex; align-items: center; justify-content: center; min-height: 100px; padding: 12px; margin-bottom: 28px; }
.auth-brand img { display: block; max-width: 230px; max-height: 78px; width: 100%; object-fit: contain; }
.auth-brand span { color: #e8f0e4; font-size: 1.15rem; font-weight: 700; text-align: center; }
.ma-page[data-page=login] h2, .login-page .login-card h1 { text-align: left; color: var(--fd-ink); font-size: 1.6rem; font-weight: 700; letter-spacing: -.04em; margin: 10px 0 26px; line-height: 1.2; }
.ma-page[data-page=login] .ma-button { min-height: 49px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; border-top: 1px solid #ccd9ce; padding-top: 19px; margin-top: 25px; font-size: .74rem; }
.auth-help { margin: 17px 0 0; font-size: .77rem; color: #526e79; }
.auth-help summary { cursor: pointer; min-height: 28px; }
.auth-help p { margin: 8px 0; }
.ma-page[data-page=login] .ma-footer { display: flex; justify-content: center; position: relative; z-index: 2; border: 0; padding: 0; margin: 0 auto 24px; }
.ma-page[data-page=login] .ma-footer__branding { display: none; }
.login-page .login-container { flex: 1; min-height: 100dvh; padding: 45px 20px; display: grid; place-items: center; position: relative; z-index: 2; }
.login-page .login-card { width: 100%; max-width: 420px; margin: 0; }
.login-page .login-card .form-group { margin-bottom: 20px; }
.login-page .login-card .btn { min-height: 49px; margin-top: 0; }
.login-page .login-card .flash-message { margin-bottom: 16px; }
.ma-page[data-page=password] .ma-auth { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 60px; }
@media (min-width: 768px) and (max-width: 1199px) {
    .nav-container { flex-wrap: wrap; gap: 14px; padding: 12px 24px; }
    .nav-brand { width: 100%; }
    .nav-menu { margin: 0; flex-basis: 100%; gap: 8px; }
    .nav-link { padding: 10px 9px; font-size: .75rem; }
    .nav-user-top { margin-left: 0; }
}
@media (max-width: 767px) {
    html { scroll-padding-top: 90px; }
    .nav-container { padding: 12px 15px; gap: 9px; }
    .nav-brand { min-width: 0; flex: 1; }
    .nav-brand-row { margin: 0; gap: 9px; }
    .nav-brand-logo { max-width: 138px !important; max-height: 43px !important; }
    .nav-brand-link { padding: 3px; }
    .company-selector-brand, .current-company-badge-brand { font-size: .59rem; max-width: 85px; padding: 5px; }
    .nav-menu { top: 74px; height: calc(100dvh - 74px); padding: 16px 12px 35px; max-width: calc(100vw - 25px); border-right: 1px solid #44616a; transition: none; }
    .nav-menu .nav-link { min-height: 44px; padding: 12px; font-size: .9rem; }
    .nav-user-top { border-left: 0; border-bottom: 1px solid #46616a; padding: 0 0 15px; margin-bottom: 12px; }
    .nav-user-top .nav-link { font-size: .82rem; }
    .nav-text-short { display: none; }
    .nav-text-full { display: inline; }
    .main-content { padding: 23px 14px 38px; }
    .page-header { padding-bottom: 18px; margin-bottom: 20px; }
    .page-header h1::before { width: 5px; margin-right: 10px; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-card { padding: 15px; }
    .kpi-label { font-size: .7rem; }
    .card { padding: 17px 14px; min-width: 0; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-metric { padding: 17px 18px; }
    .filters { padding: 12px; }
    .filters > * { flex: 0 1 auto; }
    .search-box { flex-direction: column; align-items: stretch; }
    .search-box input, .search-box .btn { width: 100%; }
    .workspace-period { align-items: stretch; flex-direction: column; }
    .workspace-period select { font-size: 16px; }
    /* These legacy inline grids contain actual fields, never visibility states. */
    .form-row { grid-template-columns: minmax(0, 1fr) !important; }
    .permission-section > div:last-child { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .table-container { max-width: 100%; }
    table { font-size: .82rem; }
    .modal-content { width: calc(100% - 22px); }
    .app-footer { flex-direction: column; padding: 22px 16px; }
    .ma-header { padding: 16px; gap: 15px; }
    .ma-brand { min-width: 0; gap: 12px; }
    .ma-brand img { max-width: 130px; max-height: 54px; }
    .ma-brand strong { font-size: .76rem; overflow-wrap: anywhere; }
    .ma-brand .ma-eyebrow { font-size: .56rem; }
    .ma-main { width: calc(100% - 28px); margin: 25px auto 45px; }
    .ma-panel { padding: 22px 17px; }
    .ma-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ma-nav button { padding: 10px; font-size: .78rem; }
    .ma-definition, .ma-toolbar { grid-template-columns: minmax(0, 1fr); }
    .ma-page dialog { padding: 24px 17px; }
    .ma-toolbar { padding: 15px; }
    .communication-nav { padding: 4px; gap: 3px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
    .communication-nav .communication-nav__item { min-height: 49px; font-size: .78rem; padding: 8px 7px; }
    .sv .communication-nav, .re-page .communication-nav { margin-bottom: 20px; }
    .sv-head { align-items: flex-start; }
    .re-page .re-section-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 3px; }
    .re-page .re-section-picker__button { padding: 9px 7px; font-size: .73rem; }
    .re-page .re-panel { padding: 20px 16px; }
    .delegation-admin .delegation-admin-toolbar { padding: 17px; }
    .ma-page[data-page=login] .ma-main, .login-page .login-container { padding: 34px 16px 72px; }
    .ma-page[data-page=login] .ma-panel, .login-page .login-card { padding: 26px 23px; }
    .auth-brand { min-height: 88px; margin-bottom: 24px; }
    .auth-brand img { max-width: 205px; }
    .radar-caption { left: 16px; bottom: 18px; font-size: .53rem; }
    .ma-page[data-page=password] .ma-auth { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 360px) {
    .nav-brand-logo { max-width: 120px !important; }
    .company-selector-brand, .current-company-badge-brand { max-width: 78px; }
    .ma-page[data-page=login] .ma-panel, .login-page .login-card { padding: 24px 19px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
