.swc-modal-open {
    overflow: hidden;
}

.swc-inspection-modal[hidden] {
    display: none;
}

.swc-inspection-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 2rem);
    position: fixed;
    z-index: 100000;
}

.swc-inspection-modal__backdrop {
    background: rgba(7, 18, 30, 0.76);
    inset: 0;
    position: absolute;
}

.swc-inspection-modal__panel {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.32);
    color: #142538;
    display: flex;
    flex-direction: column;
    max-height: min(52rem, calc(100vh - 2rem));
    max-width: 64rem;
    outline: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.swc-inspection-modal__header {
    align-items: flex-start;
    background: #0c3b60;
    color: #fff;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.swc-inspection-modal__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 0 0 0.2rem;
    opacity: 0.76;
    text-transform: uppercase;
}

.swc-inspection-modal__header h2 {
    color: inherit;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    line-height: 1.2;
    margin: 0;
}

.swc-inspection-modal__close {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0.3rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex: 0 0 2.5rem;
    font-size: 2rem;
    height: 2.5rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.swc-inspection-modal__close:hover,
.swc-inspection-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.swc-inspection-modal__body {
    overflow: auto;
    padding: 1.1rem 1.25rem;
}

.swc-inspection-modal__description {
    margin: 0 0 0.85rem;
}

.swc-inspection-modal__status {
    background: #eef5f8;
    border-left: 4px solid #0c5c8f;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
}
.swc-inspection-modal__status[data-tone="error"] { background:#fff1f0; border-color:#b42318; }
.swc-inspection-modal__status[data-tone="warning"] { background:#fff8e6; border-color:#b7791f; }
.swc-ndbc-card__meta { color:#526575; margin:0 0 1rem; }
.swc-ndbc-card__grid { display:grid; gap:0.75rem; grid-template-columns:repeat(4,minmax(0,1fr)); }
.swc-ndbc-card__metric { background:#f2f6f8; border:1px solid #cfdae1; border-radius:0.4rem; padding:0.75rem; }
.swc-ndbc-card__metric span { color:#526575; display:block; font-size:0.78rem; margin-bottom:0.25rem; }
.swc-ndbc-card__metric strong { display:block; font-size:1.02rem; }
.swc-ndbc-card__source { color:#526575; font-size:0.82rem; margin:1rem 0 0; }
.swc-inspection-modal__raw { border-top:1px solid #d8e0e5; margin-top:1rem; padding-top:0.8rem; }
.swc-inspection-modal__raw summary { cursor:pointer; font-weight:700; margin-bottom:0.75rem; }

.swc-inspection-modal__json {
    background: #f2f6f8;
    border: 1px solid #cfdae1;
    border-radius: 0.4rem;
    color: #172533;
    font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    margin: 0;
    min-height: 8rem;
    overflow: auto;
    padding: 1rem;
    tab-size: 2;
    white-space: pre-wrap;
    word-break: break-word;
}

.swc-inspection-modal__footer {
    border-top: 1px solid #d8e0e5;
    display: flex;
    justify-content: flex-end;
    padding: 0.8rem 1.25rem;
}

.swc-inspection-modal__done {
    appearance: none;
    background: #0c5c8f;
    border: 0;
    border-radius: 0.35rem;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    min-height: 2.6rem;
    padding: 0.65rem 1.25rem;
}

.swc-inspection-modal__done:hover,
.swc-inspection-modal__done:focus-visible {
    background: #08476f;
    outline: 2px solid #0c5c8f;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .swc-inspection-modal {
        align-items: stretch;
        padding: 0;
    }

    .swc-inspection-modal__panel {
        border-radius: 0;
        height: 100%;
        max-height: none;
    }

    .swc-inspection-modal__body {
        flex: 1;
    }
    .swc-ndbc-card__grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* NDBC observation history */
.swc-ndbc-card__metric--history { appearance:none; color:inherit; cursor:pointer; font:inherit; text-align:left; width:100%; }
.swc-ndbc-card__metric--history:hover,
.swc-ndbc-card__metric--history:focus-visible { border-color:#1f5d91; box-shadow:0 0 0 2px rgba(31,93,145,.12); outline:none; }
.swc-ndbc-card__metric small { color:#687b89; display:block; font-size:.68rem; margin-top:.2rem; }
.swc-ndbc-sparkline { display:block; height:34px; margin-top:.4rem; width:100%; }
.swc-ndbc-sparkline path { stroke:#2470a9; stroke-width:2; }
.swc-ndbc-history__head { align-items:center; display:flex; gap:.75rem; justify-content:space-between; margin-bottom:.75rem; }
.swc-ndbc-history__back,
.swc-ndbc-history__ranges button { background:#f2f6f8; border:1px solid #bfcdd7; border-radius:.35rem; cursor:pointer; font-weight:600; padding:.45rem .65rem; }
.swc-ndbc-history__ranges { display:flex; gap:.35rem; }
.swc-ndbc-history__ranges button.is-active { background:#1f5d91; border-color:#1f5d91; color:#fff; }
.swc-ndbc-history__summary { color:#526575; font-size:.85rem; margin:.25rem 0 .6rem; }
.swc-ndbc-history__chart { min-height:240px; overflow-x:auto; }
.swc-ndbc-history__chart svg { display:block; min-width:620px; width:100%; }
.swc-ndbc-history__gridline { stroke:#d8e0e5; stroke-width:1; }
.swc-ndbc-history__axis { fill:#526575; font-size:12px; }
.swc-ndbc-history__line { stroke:#1f5d91; stroke-width:2.5; }
.swc-ndbc-history__point { fill:#1f5d91; }

.swc-ndbc-history__stage { min-width:620px; position:relative; }
.swc-ndbc-history__night { fill:rgba(18,40,60,.07); }
.swc-ndbc-history__timeguide { pointer-events:none; stroke:#7f909c; stroke-width:1; }
.swc-ndbc-history__timeguide--midnight { stroke-width:1.5; }
.swc-ndbc-history__timeguide--noon { stroke-dasharray:4 4; }
.swc-ndbc-history__timeguide-label { fill:#6b7d89; font-size:10px; pointer-events:none; }
.swc-ndbc-history__point-hit { cursor:pointer; fill:transparent; outline:none; }
.swc-ndbc-history__point-hit:focus { stroke:#1f5d91; stroke-width:1.5; }
.swc-ndbc-history__tooltip { background:#173f64; border-radius:.35rem; box-sizing:border-box; color:#fff; font-size:.78rem; font-weight:600; max-width:calc(100% - 1rem); padding:.42rem .58rem; pointer-events:none; position:absolute; white-space:nowrap; width:max-content; z-index:2; }
.swc-ndbc-history__tooltip-time { line-height:1.2; }
.swc-ndbc-history__tooltip-value { font-size:.86rem; line-height:1.25; margin-top:.18rem; }

@media (max-width:640px) {
    .swc-ndbc-history__head { align-items:stretch; flex-direction:column; }
    .swc-ndbc-history__ranges { width:100%; }
    .swc-ndbc-history__ranges button { flex:1; }
}

.swc-ndbc-wind-value { align-items:center; display:inline-flex; gap:.45rem; }
.swc-ndbc-direction-arrow { display:inline-block; font-size:1.15em; line-height:1; transform-origin:50% 50%; }
.swc-ndbc-history__direction-arrow { fill:#173f64; font-size:13px; font-weight:700; pointer-events:none; }

/* 0.36.31 ReefCast mobile landscape: reclaim vertical space */
@media (orientation: landscape) and (max-height: 600px) {
    .swc-inspection-modal--reefcast .swc-inspection-modal__header {
        display: none;
    }

    .swc-inspection-modal--reefcast {
        padding: 0;
    }

    .swc-inspection-modal--reefcast .swc-inspection-modal__panel {
        border-radius: 0;
        height: 100%;
        max-height: 100vh;
        max-width: none;
    }

    .swc-inspection-modal--reefcast .swc-inspection-modal__body {
        flex: 1;
        padding-top: .35rem;
    }
}
