*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 3px solid #2B7BB0;
    outline-offset: 2px;
}

.w {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.mut {
    color: var(--mut);
}

.ok {
    color: var(--teal);
}

.h2 {
    font: 800 28px/1.2 var(--font);
    margin: 0 0 8px;
}

.h3 {
    font: 800 20px/1.2 var(--font);
    margin: 0 0 12px;
}

.sm {
    font-size: 14px;
}
.xs {
    font-size: 13px;
}

.stack {
    display: grid;
    gap: 16px;
    width: 100%;
}

/* Header & Footer */
.hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    padding-bottom: 16px;
    width: 100%;
}

.logo {
    font-weight: 800;
    font-size: 22px;
}

.logo b {
    color: var(--redt);
}

.hd nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-weight: 500;
}

.hd nav a[aria-current=page] {
    color: var(--redt);
    font-weight: 700;
}

.ft {
    background: var(--navy);
    color: #D8E1E8;
    padding: 40px 0;
    width: 100%;
}

.ft b {
    color: #fff;
}

.ft a {
    display: block;
}

.ft a:hover {
    color: #fff;
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 1000;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--mut);
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
}

.bottom-nav a svg {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav a[aria-current=page] {
    color: var(--redt);
}

/* Buttons */
.b {
    font: 700 15px var(--font);
    border: 0;
    border-radius: 10px;
    padding: 10px 18px;
    min-height: 42px;
    cursor: pointer;
    color: #fff;
    background: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.b.red {
    background: var(--red);
}

.b.teal {
    background: var(--teal);
}

.b.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--mut);
}

.b.danger {
    background: transparent;
    color: var(--redt);
    border: 1px solid var(--redt);
}

.b.sm {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
}

.b.lg {
    font-size: 17px;
    padding: 14px 24px;
}

/* Cards & Grids */
.c {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    width: 100%;
    overflow: hidden;
    word-break: break-word;
}

.c.dark {
    background: var(--navy);
    color: #fff;
    border: 0;
}

.g {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    width: 100%;
}

.g2 {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: start;
    width: 100%;
}

.span-all {
    grid-column: 1 / -1;
}

/* Forms */
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}

label.row {
    flex-direction: row;
    align-items: center;
    font-weight: 500;
}

input, textarea, select {
    min-height: 44px;
    border: 1px solid var(--mut);
    border-radius: 8px;
    padding: 10px 12px;
    font: 15px var(--font);
    background: var(--card);
    color: var(--ink);
    width: 100%;
}

input[type=checkbox] {
    width: 18px;
    min-height: 18px;
}

input.narrow {
    max-width: 140px;
}

.chip {
    display: inline-block;
    border: 2px solid var(--line);
    border-radius: 10px;
    padding: 9px 13px;
    font: 700 14px var(--font);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    margin: 0 6px 6px 0;
}

.chip[aria-pressed=true] {
    border-color: var(--red);
    background: var(--redbg);
}

/* Tags & Alert Bar */
.tag {
    display: inline-block;
    font: 700 11px var(--font);
    padding: 3px 7px;
    border-radius: 6px;
    color: #fff;
    background: #5A6B78;
}

.bar {
    background: #0E1F2B;
    color: #fff;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.4;
    width: 100%;
    margin: 0;
    text-align: left;
}

.bar .tag {
    background: var(--red);
    margin-right: 8px;
}

.step {
    padding: 6px 0;
    color: var(--mut);
}

.step.done {
    color: var(--ink);
    font-weight: 700;
}

.meter {
    height: 8px;
    border-radius: 4px;
    background: var(--line);
    width: 100%;
}

.meter > i {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--red);
}

.band {
    background: var(--navy);
    color: #fff;
    padding: 48px 0;
    width: 100%;
}

.band .c {
    background: transparent;
    border-color: #38566C;
}

.band .mut {
    color: #C5D3DD;
}

.cta {
    background: var(--red);
    color: #fff;
    padding: 40px 0;
    margin-top: 40px;
    width: 100%;
}

details {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    width: 100%;
}

summary {
    font-weight: 700;
    cursor: pointer;
}

.stat {
    font: 800 34px var(--font);
}

.stat-sm {
    font: 800 24px var(--font);
}

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 76px;
    background: #0E1F2B;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    z-index: 999;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 90%;
    text-align: center;
}

.toast:empty {
    display: none;
}

.req {
    margin-bottom: 12px;
    border-left: 6px solid #8A5F00;
    width: 100%;
}

.req.hot {
    border-left-color: var(--red);
}

.hero h1 {
    font: 800 40px/1.12 var(--font);
    margin: 0 0 16px;
    max-width: 780px;
}

.hero p.lead {
    font-size: 17px;
    line-height: 1.5;
    margin: 0 0 22px;
}

.cat-card {
    font: 700 16px var(--font);
    display: block;
}

.split {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

/* Tablet responsiveness (769px - 1024px) */
@media (max-width: 1024px) {
    .w {
        padding: 0 16px;
    }
}

/* Mobile responsiveness (<=768px) */
@media (max-width: 768px) {
    body {
        padding-bottom: 74px;
    }

    .bottom-nav {
        display: flex;
    }

    /* Hide desktop navigation/links on mobile since bottom-nav is used */
    .hd nav {
        display: none !important;
    }

    .hd .mut.xs {
        display: none !important;
    }

    .w {
        padding: 0 16px !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    section.w, section.band {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .h2 {
        font-size: 21px;
        margin-bottom: 20px !important;
    }

    .hd {
        padding: 16px 20px !important;
    }

    .c {
        padding: 16px;
        border-radius: 12px;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .g {
        grid-template-columns: 1fr;
        gap: 16px !important;
        width: 100%;
    }

    .hero {
        padding-top: 24px !important;
        padding-bottom: 32px !important;
    }

    .hero .b.lg, 
    .hero .b.teal.lg {
        display: inline-flex;
        width: auto;
        flex: 1;
        margin-bottom: 0;
        font-size: 14px;
        padding: 12px 14px;
        min-height: 44px;
        justify-content: center;
        text-align: center;
    }

    .c > div:has(.sm), .map-legend, div[style*="display: flex"][style*="gap"]{
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px 12px !important;
    }

    .hero .c{
        padding: 12px !important;
        overflow: hidden !important;
    }

    .map-legend{
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .map-legend > div, .map-legend span{
        white-space: nowrap !important;
        font-size: 13px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
    }
}