/* Theme colors */
:root{
--bg:#ffffff;
--muted:#f3f6fb;
--accent:#0b74de; /* Monsun blue-ish */
--card:#ffffff;
--text:#0b2340;
--home-ink:#0a2744;
--home-mist:#e8f1fa;
--home-foam:#f7fbff;
--font-ui:"Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
--font-display:"Literata", Georgia, "Times New Roman", serif;
}
*{box-sizing:border-box}
body{margin:0;font-family:var(--font-ui);color:var(--text);background:var(--bg)}
.layout{display:flex;height:100vh;min-height:100vh;}
/* Mobile header */
.mobile-header{display:none;align-items:center;gap:10px;padding:10px 12px;background:var(--card);border-bottom:1px solid #e6eef9;min-height:56px}
.mobile-title{font-weight:600}
.hamburger{font-size:20px;background:none;border:0;cursor:pointer;flex-shrink:0;padding:4px 8px}
.mobile-header .logo-link{flex:1;min-width:0;display:flex;align-items:center;justify-content:center}
.mobile-logo{height:44px;width:auto;max-width:100%;object-fit:contain;display:block}


/* Sidebar */
.sidebar{width:240px;background:linear-gradient(180deg,#ffffff, #f8fbff);border-right:1px solid #e6eef9;padding:20px 16px;flex-shrink:0}
.logo-link{display:block;text-decoration:none;color:inherit;cursor:pointer}
.logo-link:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:6px}
.logo{width:100%;max-width:208px;height:auto;display:block;margin:0 auto 18px;object-fit:contain}
.menu{display:flex;flex-direction:column;gap:8px}
.menu button{background:transparent;border:0;text-align:left;padding:10px 12px;border-radius:8px;cursor:pointer;font-weight:500}
.menu button:hover{background:#eef6ff}
.menu button.active{background:linear-gradient(90deg, rgba(11,116,222,0.12), rgba(11,116,222,0.06));color:var(--accent)}


/* Content area */
.content{flex:1;padding:18px;overflow:auto;background:var(--bg);min-height:0}
.section{display:none}
.section.active{display:block}
.header-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}


/* Controls */
.controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.controls select{
    padding:6px 8px;
    border:1px solid #dfeaf7;
    border-radius:8px;
    background:white;
    flex:1 1 0;
    min-width:0;
    max-width:150px;
    width:130px;
}
.controls select#parameterSelect,
.controls select#timeSelect{
    max-width:220px;
    width:200px;
    flex:1.4 1 0;
}

.timectrl-top {
    width: 100%;
    flex: 1 0 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.timectrl-btns {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.timectrl-btns button {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #dfeaf7;
    background: white;
    cursor: pointer;
}

/* Clickable forecast time strip */
.timeline {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 8px 7px;
    border: 1px solid #dfeaf7;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfdff, #f3f8ff);
    scrollbar-width: thin;
}

.timeline.is-empty {
    display: none;
}

.tl-day {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 10px;
    border-right: 1px dashed #d8e5f5;
}

.tl-day:last-child {
    padding-right: 0;
    border-right: 0;
}

.tl-day-label {
    padding-left: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #5b7899;
    white-space: nowrap;
}

.tl-hours {
    display: flex;
    gap: 4px;
}

.tl-tick {
    flex: 0 0 auto;
    min-width: 40px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    cursor: pointer;
}

.tl-tick:hover {
    background: #eaf3ff;
    border-color: #cfe0f5;
}

.tl-tick.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tl-tick:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* outer container: sized by fitMapToViewport() to the image + padding */
.map-container {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    background: linear-gradient(180deg,#f6fbff,#ffffff);
    border: 1px solid #e6eef9;
    border-radius: 10px;
    padding: 8px;
}

/* inner container: relative for overlays */
.map-inner {
    position: relative;
    width: fit-content;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Display size is set by fitMapToViewport() based on image aspect + viewport */
#mapImage {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
}

#regionOverlay {
    position:absolute;
    top:0; left:0;
    width:100%; height:100%;
    cursor:pointer;
    z-index: 2;
}

#regionOverlay.overlay-inactive {
    pointer-events: none;
    cursor: default;
}

#regionHighlight {
    position:absolute;
    top:0; left:0;
    background:rgba(0,0,0,0.15);
    pointer-events:none;
    display:none;
}

#regionLabel {
    position:absolute;
    padding:4px 8px;
    background:rgba(0,0,0,0.6);
    color:white;
    font-size:14px;
    border-radius:4px;
    pointer-events:none;
    display:none;
}

/* Home */
.home-section {
    position: relative;
    min-height: calc(100vh - 36px);
    padding: 28px 8px 48px;
    overflow: hidden;
}
.home-section::before {
    content: "";
    position: absolute;
    inset: -8% -6% auto;
    height: min(58vh, 520px);
    background:
        radial-gradient(ellipse 70% 55% at 12% 20%, rgba(11, 116, 222, 0.16), transparent 70%),
        radial-gradient(ellipse 55% 45% at 88% 8%, rgba(31, 122, 92, 0.12), transparent 65%),
        linear-gradient(180deg, var(--home-foam), transparent 78%);
    pointer-events: none;
    z-index: 0;
}
.home-hero,
.home-services {
    position: relative;
    z-index: 1;
    max-width: 44rem;
}
.home-hero {
    margin: 12px 0 40px;
}
.home-eyebrow {
    margin: 0 0 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4f6f8f;
}
.home-brand {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.55rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--home-ink);
}
.home-lede {
    margin: 0;
    max-width: 36rem;
    font-size: 1.08rem;
    line-height: 1.55;
    color: #3d5570;
}
.home-services {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #d7e5f4;
}
.home-service {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px 22px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 22px 4px;
    border: 0;
    border-bottom: 1px solid #d7e5f4;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 160ms ease, padding-left 160ms ease;
}
.home-service:hover,
.home-service:focus-visible {
    background: linear-gradient(90deg, rgba(11, 116, 222, 0.06), transparent 70%);
    padding-left: 10px;
    outline: none;
}
.home-service-index {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #7a92ab;
    font-variant-numeric: tabular-nums;
}
.home-service-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.home-service-title {
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--home-ink);
}
.home-service-copy {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #4a627c;
}
.home-service-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.home-service-state {
    display: inline-block;
    padding: 2px 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b8299;
}
.home-service-state--live {
    color: #0f6b3a;
}
.home-service-action {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
}
.home-service[data-soon="true"] .home-service-action {
    color: #7a92ab;
}

.overview-btn {
    padding: 6px 10px;
    border: 1px solid #dfeaf7;
    border-radius: 8px;
    background: white;
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    width: auto;
    white-space: nowrap;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
}

.overview-btn:hover {
    background: #f0f7ff;
    border-color: #cfe0f5;
}

/* Status page */
.status-intro {
    color: #4a5d73;
    max-width: 52rem;
    margin: 0 0 16px;
    line-height: 1.45;
}
.status-panel {
    max-width: 960px;
}
.status-loading,
.status-empty {
    color: #4a5d73;
}
.status-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 18px;
}
.status-meta {
    margin: 0;
    color: #4a5d73;
    font-size: 0.95rem;
}
.status-heading {
    margin: 18px 0 10px;
    font-size: 1.05rem;
}
.status-services {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.status-service {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e6eef9;
    background: #f8fbff;
    border-radius: 8px;
    min-width: 180px;
}
.status-service-label {
    font-weight: 600;
    flex: 1;
}
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}
.status-badge--operational,
.status-badge--fresh {
    background: #e7f7ee;
    color: #0f6b3a;
}
.status-badge--planned,
.status-badge--unknown {
    background: #eef2f7;
    color: #4a5d73;
}
.status-badge--stale,
.status-badge--degraded {
    background: #fff3e0;
    color: #9a5b00;
}
.status-badge--unavailable {
    background: #fdeceb;
    color: #9b1c1c;
}
.status-table-wrap {
    overflow-x: auto;
    border: 1px solid #e6eef9;
    border-radius: 8px;
    background: #fff;
}
.status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.status-table th,
.status-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eef3f9;
    vertical-align: top;
}
.status-table th {
    background: #f8fbff;
    font-weight: 600;
    white-space: nowrap;
}
.status-table tbody tr:last-child td {
    border-bottom: 0;
}
.status-table code {
    font-size: 0.88em;
    background: #f3f6fb;
    padding: 1px 5px;
    border-radius: 4px;
}
.status-ds-name {
    font-weight: 600;
}
.status-ds-source,
.status-ds-products {
    color: #4a5d73;
    font-size: 0.82rem;
    margin-top: 2px;
}
.status-footnote {
    margin-top: 14px;
    color: #6b7c90;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 52rem;
}

/* FAQs */
.faqs-intro {
    color: #4a5d73;
    max-width: 40rem;
    margin: 0 0 18px;
    line-height: 1.45;
}
.faq-list {
    max-width: 44rem;
    border-top: 1px solid #d7e5f4;
}
.faq-item {
    border-bottom: 1px solid #d7e5f4;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 28px 16px 0;
    position: relative;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--home-ink, var(--text));
    line-height: 1.35;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 16px;
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--accent);
    line-height: 1;
}
.faq-item[open] summary::after {
    content: "–";
}
.faq-item summary:hover,
.faq-item summary:focus-visible {
    color: var(--accent);
    outline: none;
}
.faq-item p {
    margin: 0 0 16px;
    padding-right: 28px;
    color: #3d5570;
    line-height: 1.55;
    font-size: 0.98rem;
}
.faq-item a {
    color: var(--accent);
}
.faq-item code {
    font-size: 0.9em;
    background: #f3f6fb;
    padding: 1px 5px;
    border-radius: 4px;
}

/* Site Forecast */
.site-intro {
    color: #4a5d73;
    max-width: 52rem;
    margin: 0 0 14px;
    line-height: 1.45;
}
.site-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.site-controls select {
    padding: 6px 8px;
    border: 1px solid #dfeaf7;
    border-radius: 8px;
    background: white;
    min-width: 220px;
    max-width: 360px;
}
.site-download-btn {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #dfeaf7;
    border-radius: 8px;
    background: white;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.site-download-btn:hover {
    background: #f0f7ff;
    border-color: #cfe0f5;
}
.site-download-btn[hidden] {
    display: none !important;
}
.site-summary {
    margin: 0 0 14px;
    color: #4a5d73;
    font-size: 0.9rem;
    line-height: 1.4;
}
.site-overview {
    max-width: 960px;
}
.site-overview[hidden] {
    display: none !important;
}
.site-map {
    position: relative;
    width: 100%;
    height: clamp(320px, 62dvh, 680px);
    border: 1px solid #e6eef9;
    border-radius: 8px;
    overflow: hidden;
    background: #a9c8e8;
}
.site-map-loading,
.site-map-error {
    margin: 0;
    padding: 18px;
    color: #4a5d73;
    line-height: 1.4;
}
.site-map.leaflet-container {
    font-family: inherit;
    background: #a9c8e8;
    /* Keep Leaflet panes (z-index 200–800) inside the map so they cannot
       paint over the mobile sidebar / header. */
    isolation: isolate;
    z-index: 0;
}
.site-map .leaflet-tooltip {
    border: 0;
    border-radius: 5px;
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(11, 35, 64, 0.18);
}
.site-panel {
    max-width: 960px;
}
.site-panel[hidden] {
    display: none !important;
}
.site-placeholder {
    color: #4a5d73;
    margin: 8px 0;
}
.site-chart-block {
    margin-bottom: 18px;
}
.site-chart-title {
    margin: 0 0 6px;
    font-size: 1.02rem;
}
.site-chart-wrap {
    position: relative;
    height: 200px;
    border: 1px solid #e6eef9;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px 4px;
}
.site-dir-note {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #5a6d82;
    line-height: 1.35;
}

/* Route Forecast */
.route-intro {
    color: #4a5d73;
    max-width: 52rem;
    margin: 0 0 16px;
    line-height: 1.45;
}
.route-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
    max-width: 960px;
    margin-bottom: 14px;
}
.route-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 170px;
}
.route-field span {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5a6d82;
}
.route-field select,
.route-field input {
    padding: 7px 9px;
    border: 1px solid #dfeaf7;
    border-radius: 8px;
    background: white;
    color: var(--text);
    font: inherit;
}
.route-plan-btn {
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.route-plan-btn:hover {
    filter: brightness(1.06);
}
.route-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    max-width: 960px;
    margin: 0 0 12px;
    padding: 14px 16px;
    border: 1px solid #e6eef9;
    border-radius: 10px;
    background: #f7fbff;
    color: #4a5d73;
    line-height: 1.4;
}
.route-stat {
    display: flex;
    flex-direction: column;
}
.route-stat strong {
    font-family: var(--font-display);
    font-size: 1.22rem;
    color: var(--text);
    line-height: 1.2;
}
.route-stat span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7f95;
}
.route-warnings {
    max-width: 960px;
    margin: 0 0 12px;
    padding: 12px 16px;
    border: 1px solid #f0d2d2;
    border-left: 4px solid #D64545;
    border-radius: 8px;
    background: #fdf5f5;
}
.route-warnings[hidden] {
    display: none !important;
}
.route-warnings ul {
    margin: 0;
    padding-left: 18px;
    color: #7a2f2f;
    font-size: 0.9rem;
    line-height: 1.5;
}
.route-map {
    position: relative;
    width: 100%;
    max-width: 960px;
    height: clamp(320px, 56dvh, 620px);
    border: 1px solid #e6eef9;
    border-radius: 8px;
    overflow: hidden;
    background: #a9c8e8;
}
.route-map-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.route-placeholder {
    margin: 0;
    padding: 18px;
    color: #4a5d73;
    line-height: 1.4;
}
.route-chart-wrap {
    position: relative;
    max-width: 960px;
    height: 240px;
    margin-top: 16px;
    border: 1px solid #e6eef9;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px 4px;
}
.route-legs {
    max-width: 960px;
    margin-top: 16px;
    overflow-x: auto;
}
.route-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.route-table th,
.route-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e6eef9;
    white-space: nowrap;
}
.route-table th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5a6d82;
}
.route-table td:first-child {
    white-space: normal;
}
.route-leg--unsafe td {
    background: #fdf5f5;
    color: #7a2f2f;
}
.route-note {
    max-width: 52rem;
    margin: 14px 0 0;
    font-size: 0.82rem;
    color: #5a6d82;
    line-height: 1.45;
}

/* Responsive */
@media (max-width:768px){
.mobile-header{display:flex;position:sticky;top:0;z-index:1200}
.layout{flex-direction:column;height:auto;min-height:calc(100dvh - 56px)}
.sidebar{width:100%;display:none;position:fixed;left:0;top:56px;height:calc(100dvh - 56px);z-index:1100;padding:20px 16px;overflow:auto}
.sidebar.open{display:block;background:linear-gradient(180deg,#ffffff, #f8fbff);box-shadow:0 8px 30px rgba(11,36,67,0.08)}
.sidebar .logo-container{padding:0 8px 12px}
.sidebar .logo{max-width:min(320px,88vw);width:100%;margin:0 auto 20px}
.content{padding:14px}
.menu{flex-direction:column}
.controls{flex-direction:column;align-items:stretch}
.timectrl{margin-left:0}
.timectrl-top{flex-direction:column;align-items:stretch;gap:10px}
.timectrl-btns{justify-content:center}
.timeline{width:100%}
.controls select{
    min-width:100%;
    max-width:100%;
    width:100%;
}
.overview-btn{
    min-width:100%;
    max-width:100%;
    width:100%;
}
.site-controls{flex-direction:column;align-items:stretch}
.site-controls select{min-width:100%;max-width:100%;width:100%}
.site-download-btn{text-align:center}
.site-chart-wrap{height:200px}
.site-map{height:min(58dvh,520px);min-height:300px}
.route-controls{flex-direction:column;align-items:stretch}
.route-field{min-width:100%}
.route-plan-btn{width:100%}
.route-summary{gap:12px 20px}
.route-map{height:min(52dvh,460px);min-height:280px}
.route-chart-wrap{height:220px}
.home-section{min-height:auto;padding:12px 0 28px}
.home-hero{margin:4px 0 28px}
.home-service{
    grid-template-columns: auto 1fr;
    gap: 12px 14px;
    padding: 18px 2px;
}
.home-service-meta{
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.map-container {
    width: fit-content;
    max-width: 100%;
}
}
@media (max-height:600px) and (orientation:landscape){
.site-map{height:min(68dvh,380px);min-height:250px}
}
select::-ms-expand{display:none}