html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    overflow: hidden;
    background: #f8f9fa;
}

#studio-sidebar {
    position: relative;
    z-index: 1000;
    flex: 0 0 clamp(320px, 27vw, 440px);
    width: clamp(320px, 27vw, 440px);
    height: 100%;
    background: #fff;
    border-right: 1px solid #ced4da;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    transition:
        flex-basis 0.18s ease,
        width 0.18s ease,
        transform 0.18s ease;
    overflow: hidden;
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-header {
    min-height: 58px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #0879d1;
    color: white;
}

.sidebar-header h1 {
    margin: 0;
    min-width: 0;
    flex: 1;
    font-size: clamp(1.05rem, 0.92rem + 0.45vw, 1.5rem);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    color: #343a40;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    white-space: nowrap;
}

.sidebar-toggle,
.sidebar-reopen {
    border: 0;
    cursor: pointer;
}

.sidebar-toggle {
    background: transparent;
    color: white;
    font-size: 1.1rem;
}

.sidebar-reopen {
    position: absolute;
    z-index: 1200;
    top: 0.75rem;
    left: 0.75rem;
    width: 42px;
    height: 42px;
    border-radius: 0.35rem;
    background: #0879d1;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.sidebar-reopen[hidden] {
    display: none !important;
}

.studio-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.studio-navigation button {
    flex: 1 1 auto;
    min-width: 78px;
}

.sidebar-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
}

.studio-panel {
    display: none;
}

.studio-panel.active {
    display: block;
}

.placeholder-card {
    border: 1px solid #d9e1e7;
    border-radius: 0.45rem;
    background: #f8fbfd;
    padding: 1rem;
    margin-bottom: 1rem;
}

.placeholder-card h2 {
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

.placeholder-card p:last-child {
    margin-bottom: 0;
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(100px, 1fr);
    gap: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.diagnostic-grid dt,
.diagnostic-grid dd {
    margin: 0;
}

.diagnostic-grid dt {
    font-weight: 600;
}

.diagnostic-grid dd {
    text-align: right;
    word-break: break-word;
}

#map-shell {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.map-status {
    position: absolute;
    z-index: 800;
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.3rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.16);
    font-size: 0.8rem;
    pointer-events: none;
}

#studio-sidebar.sidebar-collapsed {
    flex-basis: 0;
    width: 0;
    border-right: 0;
    transform: translateX(-100%);
}

#studio-sidebar.sidebar-collapsed .sidebar-inner {
    visibility: hidden;
}

@media (max-width: 1199.98px) {
    #studio-sidebar {
        flex-basis: clamp(300px, 34vw, 390px);
        width: clamp(300px, 34vw, 390px);
    }
}

@media (max-width: 899.98px) {
    #studio-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: min(90vw, 390px);
        max-width: calc(100vw - 48px);
        flex-basis: auto;
    }

    #studio-sidebar.sidebar-collapsed {
        width: min(90vw, 390px);
        transform: translateX(-105%);
    }

    #map-shell {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .sidebar-header {
        padding: 0.65rem 0.75rem;
    }

    .sidebar-content {
        padding: 0.75rem;
    }

    .studio-navigation button {
        min-width: 70px;
    }

    .diagnostic-grid {
        grid-template-columns: 1fr;
    }

    .diagnostic-grid dd {
        text-align: left;
        margin-bottom: 0.4rem;
    }
}

/*
 * Leaflet control spacing.
 * Keep the development status label clear of the scale and attribution.
 */
.leaflet-top.leaflet-right {
    top: 0.25rem;
    right: 0.25rem;
}

.leaflet-control-layers,
.leaflet-control-zoom {
    margin-right: 0.5rem !important;
}

.leaflet-bottom.leaflet-right {
    right: 0.25rem;
    bottom: 0.25rem;
}

.map-status {
    left: 0.75rem;
    right: auto;
    bottom: 0.75rem;
}





/* === MPAS SIDEBAR INSET START === */

/*
 * Match the validated WRF Configuration Studio visual treatment:
 * the sidebar floats slightly inside the browser viewport instead of
 * touching the top, left, and bottom edges.
 */
#studio-sidebar {
    margin: 8px 6px 8px 8px;
    height: calc(100% - 16px);
    border: 1px solid #b9c4cc;
    border-radius: 4px;
    overflow: hidden;
}

/*
 * When collapsed, remove the inset margins as well so the map can
 * reclaim the full horizontal space.
 */
#studio-sidebar.sidebar-collapsed {
    margin-left: 0;
    margin-right: 0;
}

/* Preserve the inset treatment when the sidebar becomes an overlay. */
@media (max-width: 899.98px) {
    #studio-sidebar {
        top: 8px;
        left: 8px;
        margin: 0;
        height: calc(100% - 16px);
        max-height: calc(100% - 16px);
    }

    #studio-sidebar.sidebar-collapsed {
        margin: 0;
    }
}

@media (max-width: 575.98px) {
    #studio-sidebar {
        top: 6px;
        left: 6px;
        height: calc(100% - 12px);
        max-height: calc(100% - 12px);
    }
}

/* === MPAS SIDEBAR INSET END === */


/* === WRF-STYLE MAP OVERLAY SIDEBAR START === */

/*
 * The validated WRF Configuration Studio does not reserve a white
 * layout column for its sidebar. The map fills the viewport and the
 * sidebar is absolutely positioned over the map with a 10 px inset.
 *
 * This makes the visible space around the panel show the map itself,
 * which is the transparent/inset effect used by the WRF interface.
 */

#app {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

#map-shell {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    z-index: 0;
}

/*
 * Float the MPAS sidebar over the map.
 * Width continues to come from the visual-scale rules already applied.
 */
#studio-sidebar {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 1000;

    margin: 0;
    height: auto;

    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(0, 0, 0, 0.20);
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

/*
 * Do not leave a white strip when the sidebar is collapsed.
 * The map is already full-width underneath it.
 */
#studio-sidebar.sidebar-collapsed {
    width: 0;
    min-width: 0;
    flex-basis: 0;
    border: 0;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    transform: none;
}

/*
 * Keep the reopen control floating over the map in the same inset area.
 */
.sidebar-reopen {
    top: 10px;
    left: 10px;
}

/*
 * Keep the development status label visible to the right of the
 * overlaid sidebar rather than underneath it.
 */
.map-status {
    left: calc(clamp(340px, 23vw, 390px) + 24px);
    right: auto;
}

/*
 * The map itself always occupies the complete browser viewport.
 */
#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/*
 * On the narrower desktop/tablet layout, match the alternate sidebar
 * width used by the existing MPAS responsive rules.
 */
@media (max-width: 1199.98px) {
    .map-status {
        left: calc(clamp(310px, 32vw, 360px) + 24px);
    }
}

/*
 * At small widths the sidebar remains an overlaid panel, still with
 * the map visible around its perimeter.
 */
@media (max-width: 899.98px) {
    #studio-sidebar {
        top: 10px;
        bottom: 10px;
        left: 10px;
        height: auto;
        max-height: none;
        margin: 0;
    }

    #studio-sidebar.sidebar-collapsed {
        width: 0;
        opacity: 0;
        transform: none;
    }

    .map-status {
        left: 12px;
        bottom: 12px;
    }
}

@media (max-width: 575.98px) {
    #studio-sidebar {
        top: 6px;
        bottom: 6px;
        left: 6px;
    }

    .sidebar-reopen {
        top: 6px;
        left: 6px;
    }
}

/* === WRF-STYLE MAP OVERLAY SIDEBAR END === */

/* === MPAS MULTI-VIEW MAP WORKSPACE START === */













.globe-loading,
.globe-error {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #fff;
    font-size: 1rem;
    text-align: center;
}



body[data-map-view="globe"] .leaflet-control-container {
    display: none;
}

/*
 * Cesium fills the same map workspace underneath the floating MPAS sidebar.
 */


/* === MPAS MULTI-VIEW MAP WORKSPACE END === */

/* === MPAS MAP PARITY / POLAR REFERENCE START === */

.map-view-card {
    background: rgba(248, 251, 253, 0.97);
}

.map-view-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #495057;
}

.map-view-note {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #6c757d;
}

#globe {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1;
}

body[data-map-view="globe"] #map {
    display: none;
}

body[data-map-view="globe"] #globe {
    display: block;
}

.globe-loading,
.globe-error {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.globe-error {
    color: #ffb3b3;
}

.globe-basemap-control {
    display: none;
    position: absolute;
    z-index: 900;
    top: 12px;
    right: 12px;
    width: 188px;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.globe-basemap-control label {
    display: block;
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #495057;
}

body[data-map-view="globe"] .globe-basemap-control {
    display: block;
}

#globe .cesium-widget,
#globe .cesium-widget canvas {
    width: 100%;
    height: 100%;
}

.mpas-polar-place-icon,
.mpas-polar-marine-icon {
    background: transparent;
    border: 0;
}

.mpas-polar-place-label,
.mpas-polar-station-label,
.mpas-polar-marine-label {
    display: inline-block;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    pointer-events: none;
    text-shadow:
        -1px -1px 0 rgba(255, 255, 255, 0.92),
         1px -1px 0 rgba(255, 255, 255, 0.92),
        -1px  1px 0 rgba(255, 255, 255, 0.92),
         1px  1px 0 rgba(255, 255, 255, 0.92);
}

.mpas-polar-place-label {
    color: #30363b;
    font-size: 11px;
    font-weight: 600;
}

.mpas-polar-station-label {
    color: #5c2b29;
    font-size: 10px;
    font-weight: 700;
}

.mpas-polar-marine-label {
    color: #42677d;
    font-size: 11px;
    font-style: italic;
    letter-spacing: 0.01em;
}

.mpas-polar-marine-label.major {
    font-size: 13px;
    font-weight: 600;
}

/* === MPAS MAP PARITY / POLAR REFERENCE END === */

/* === EXACT WRF POLAR CARTOGRAPHY PORT START === */
/* ==========================================================
 * Polar reference cartography
 * ========================================================== */

.polar-reference-label-icon {
  background: transparent;
  border: 0;
  pointer-events: none;
}

.polar-reference-label {
  position: absolute;
  left: 5px;
  top: 0;
  display: block;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;

  color: #3f4852;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;

  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.95),
     1px -1px 0 rgba(255, 255, 255, 0.95),
    -1px  1px 0 rgba(255, 255, 255, 0.95),
     1px  1px 0 rgba(255, 255, 255, 0.95),
     0     0   3px rgba(255, 255, 255, 0.95);

  transform: translateY(-50%);
}


.polar-reference-label-capital {
  color: #202830;
  font-size: 11px;
  font-weight: 600;
}


.polar-reference-label-world-city {
  color: #2e3740;
  font-weight: 500;
}

.polar-reference-label-station {
  color: #3f4852;
  font-size: 10px;
  font-style: italic;
}

/*
 * Polar marine geographic labels.
 *
 * These intentionally sit below populated-place and scientific-station
 * labels in the visual hierarchy.
 */
.polar-reference-marine-label-icon {
  background: transparent;
  border: 0;
  pointer-events: none;
}

.polar-reference-marine-label {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;

  color: #687a89;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.4px;

  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.78),
     1px -1px 0 rgba(255, 255, 255, 0.78),
    -1px  1px 0 rgba(255, 255, 255, 0.78),
     1px  1px 0 rgba(255, 255, 255, 0.78),
     0     0   3px rgba(255, 255, 255, 0.75);

  transform: translate(-50%, -50%);
}

.polar-reference-marine-label-major {
  color: #596d7d;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}
/* === EXACT WRF POLAR CARTOGRAPHY PORT END === */


/* WRF-style live latitude/longitude map control. */
.leaflet-control-coordinates {
  background: rgba(255, 255, 255, 0.7);
  width: 100px;
  padding: 2px 0;
  color: #30363b;
  font-size: 11px;
  line-height: 1.25;
}

.leaflet-control-coordinates div {
  margin-left: 5px;
}

.leaflet-control-coordinates div span {
  width: 30px;
  font-weight: bold;
  display: inline-block;
}

.map-status {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.25;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 3px;
}

/* === EXACT WRF GRATICULE CSS START === */
.leaflet-gridLines-pane {
  z-index: 210;
}
.leaflet-grid-label .gridlabel-vert {
  margin-left: 8px;
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
}
.leaflet-grid-label .gridlabel-vert,
.leaflet-grid-label .gridlabel-horiz {
  padding-left: 2px;
  text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
/* === EXACT WRF GRATICULE CSS END === */


/* === MPAS ABOUT PANEL START === */

.mpas-about-panel {
    padding-bottom: 0.75rem;
}

.mpas-about-panel h2 {
    margin: 0 0 0.6rem;
    font-size: 1.22rem;
    font-weight: 600;
}

.mpas-about-panel h5 {
    margin: 0 0 0.55rem;
    font-size: 0.98rem;
    font-weight: 600;
}

.mpas-about-panel p {
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.mpas-about-intro {
    padding: 0.15rem 0 0.2rem;
}

.mpas-about-section {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid #dee2e6;
}

.mpas-about-version-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    margin-top: 0.65rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #d7e0e6;
    border-radius: 0.3rem;
    background: rgba(248, 251, 253, 0.86);
    font-size: 0.82rem;
}

.mpas-about-list {
    margin: 0.4rem 0 0;
    padding-left: 1.15rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.mpas-about-list li {
    margin-bottom: 0.2rem;
}

.mpas-about-links {
    margin-bottom: 0.25rem;
}

.mpas-about-links .list-group-item {
    padding: 0.48rem 0.65rem;
    font-size: 0.84rem;
    line-height: 1.25;
}

.mpas-about-diagnostics details {
    padding: 0.5rem 0.6rem;
    border: 1px solid #d7e0e6;
    border-radius: 0.3rem;
    background: rgba(248, 251, 253, 0.78);
}

.mpas-about-diagnostics summary {
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: #495057;
    user-select: none;
}

.mpas-about-diagnostics summary:hover {
    color: #0879d1;
}

.mpas-about-diagnostics .diagnostic-grid {
    margin: 0.65rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 575.98px) {
    .mpas-about-panel p,
    .mpas-about-list {
        font-size: 0.86rem;
    }

    .mpas-about-version-row {
        display: block;
    }

    .mpas-about-version-row span {
        display: block;
        margin-bottom: 0.2rem;
    }
}

/* === MPAS ABOUT PANEL END === */


/* === MPAS SIDEBAR PROPORTION FIX START === */

/*
 * Match the visual footprint of the WRF Configuration Studio sidebar
 * rather than copying WRF's raw breakpoint widths.
 *
 * The WRF reference occupies about 22.5% of the map viewport at the
 * desktop size used for comparison.  Using viewport-relative sizing
 * keeps that proportion stable when Chrome zoom/DPR changes.
 */
@media (min-width: 768px) {
    #studio-sidebar:not(.sidebar-collapsed) {
        width: clamp(305px, 22.5vw, 460px) !important;
        min-width: clamp(305px, 22.5vw, 460px) !important;
        max-width: clamp(305px, 22.5vw, 460px) !important;
        flex: 0 0 clamp(305px, 22.5vw, 460px) !important;
    }

    .map-status {
        left: calc(clamp(305px, 22.5vw, 460px) + 20px) !important;
    }
}

/*
 * The collapsed floating sidebar must not reserve map space.
 */
#studio-sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex-basis: 0 !important;
}

/* === MPAS SIDEBAR PROPORTION FIX END === */


/* === MPAS WRF SOURCE SIDEBAR PARITY START === */

/*
 * Source-derived WRF Configuration Studio sidebar parity.
 *
 * WRF source values used here:
 *   sidebar rail:       40px
 *   rail item:          40px x 40px
 *   rail icon size:     12pt
 *   pane header:        40px
 *   pane header text:   14.4pt
 *   sidebar base text:  16px
 *   pane padding:       10px
 *   active blue:        #0074d9
 *
 * MPAS keeps its already-validated responsive outer width and map
 * behavior. Only the internal sidebar architecture is matched to WRF.
 */

#studio-sidebar .sidebar-inner {
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    font-size: 16px !important;
}

/* Rail and pane column occupy the full sidebar height. */
.sidebar-workspace {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
}

/* ---------------------------------------------------------------
 * WRF-style 40px icon rail.
 * --------------------------------------------------------------- */

.studio-navigation {
    position: relative !important;
    display: flex !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 100% !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
}

.studio-navigation button,
.studio-navigation button.btn,
.studio-navigation button.btn-sm,
.studio-navigation button.btn-primary,
.studio-navigation button.btn-outline-secondary {
    display: block !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #333 !important;
    font-size: 12pt !important;
    line-height: 40px !important;
    text-align: center !important;
    overflow: hidden !important;
    transition: all 80ms !important;
}

.studio-navigation button:hover,
.studio-navigation button:focus {
    color: #000 !important;
    background: #eee !important;
    outline: none !important;
}

.studio-navigation button.active,
.studio-navigation button.active:hover,
.studio-navigation button.active:focus {
    color: #fff !important;
    background: #0074d9 !important;
}

.studio-navigation button i {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    line-height: 40px !important;
    vertical-align: top !important;
}

.studio-nav-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------------------------------------------------------------
 * WRF-style content column and pane header.
 * --------------------------------------------------------------- */

.sidebar-main-column {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.95) !important;
}

.sidebar-header {
    position: relative !important;
    display: flex !important;
    flex: 0 0 40px !important;
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 40px 0 20px !important;
    gap: 8px !important;
    color: #fff !important;
    background: #0074d9 !important;
}

#sidebar-section-title {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #fff !important;
    font-size: 14.4pt !important;
    font-weight: 400 !important;
    line-height: 40px !important;
}

.sidebar-header .version-badge {
    display: inline-block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0.2em 0.4em !important;
    border-radius: 0.25rem !important;
    color: #343a40 !important;
    background: #f8f9fa !important;
    font-size: 0.55em !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.sidebar-header .sidebar-toggle {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    display: block !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
    font-size: 12pt !important;
    line-height: 40px !important;
    text-align: center !important;
    cursor: pointer !important;
}

.sidebar-header .sidebar-toggle:hover,
.sidebar-header .sidebar-toggle:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    outline: none !important;
}

/* ---------------------------------------------------------------
 * Pane body. WRF's first-party CSS overrides vendor 20px padding
 * with 10px, so use the same value here.
 * --------------------------------------------------------------- */

.sidebar-content {
    position: relative !important;
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    color: #212529 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* MPAS uses h2 elements where WRF often uses compact labels/headings.
 * Normalize those to WRF-like sidebar scale rather than Bootstrap h2.
 */
.map-view-card h2,
.placeholder-card h2,
#panel-mesh h2,
#panel-init h2,
#panel-atmosphere h2,
#panel-streams h2 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
}

/* Use Bootstrap's actual small-control scale used throughout WRF. */
#studio-sidebar .form-control-sm,
#studio-sidebar .btn-sm {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

#studio-sidebar .form-control-sm {
    height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
}

#studio-sidebar .btn-sm {
    padding: 0.25rem 0.5rem !important;
}

/* Compact top view block without inventing a separate dashboard style. */
.map-view-card {
    margin: 0 0 0.5rem 0 !important;
    padding: 0 0 0.5rem 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #dee2e6 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.map-view-card .map-view-label {
    display: block !important;
    margin-bottom: 0.25rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
}

.map-view-note {
    margin-top: 0.35rem !important;
    color: #6c757d !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
}

/* Supporting MPAS information blocks remain compact. */
.placeholder-card:not(.map-view-card) {
    margin: 0 0 0.5rem 0 !important;
    padding: 0.5rem !important;
    border: 1px solid #c9d6e2 !important;
    border-radius: 4px !important;
    background: #f8fbff !important;
    box-shadow: none !important;
}

.placeholder-card:not(.map-view-card) p {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1rem !important;
    line-height: 1.45 !important;
}

.placeholder-card:not(.map-view-card) p:last-child {
    margin-bottom: 0 !important;
}

/* Strong text follows surrounding size. */
#studio-sidebar strong,
#studio-sidebar b {
    font-size: inherit !important;
}

/* === MPAS WRF SOURCE SIDEBAR PARITY END === */


/* === MPAS EXACT WRF ICON BAR START === */

/*
 * Direct port of the WRF Configuration Studio / leaflet-sidebar
 * navigation-bar structure and visual behavior.
 *
 * WRF values:
 *   rail width       40px
 *   tab height       40px
 *   icon size        12pt
 *   inactive         #333 on white
 *   hover            #000 on #eee
 *   active           white on #0074d9
 *
 * Only positioning is adapted from absolute to flex so it fits the
 * MPAS sidebar shell without altering map geometry or sidebar width.
 */

.mpas-sidebar-tabs {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;

    display: block !important;
    flex: 0 0 40px !important;

    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;

    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    background-color: #fff !important;
    overflow: hidden !important;
}

.mpas-sidebar-tabs > ul {
    position: relative !important;

    width: 40px !important;

    margin: 0 !important;
    padding: 0 !important;

    list-style-type: none !important;
}

.mpas-sidebar-tabs > ul > li {
    width: 100% !important;
    height: 40px !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #333 !important;
    background-color: transparent !important;

    font-size: 12pt !important;

    overflow: hidden !important;
    transition: all 80ms !important;
}

.mpas-sidebar-tabs > ul > li:hover {
    color: #000 !important;
    background-color: #eee !important;
}

.mpas-sidebar-tabs > ul > li.active,
.mpas-sidebar-tabs > ul > li.active:hover {
    color: #fff !important;
    background-color: #0074d9 !important;
}

.mpas-sidebar-tabs > ul > li > a {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    color: inherit !important;
    background: transparent !important;

    line-height: 40px !important;
    text-decoration: none !important;
    text-align: center !important;

    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    cursor: pointer !important;
}

.mpas-sidebar-tabs > ul > li > a:hover,
.mpas-sidebar-tabs > ul > li > a:focus,
.mpas-sidebar-tabs > ul > li > a:active {
    color: inherit !important;
    background: transparent !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.mpas-sidebar-tabs > ul > li > a > i {
    display: inline-block !important;

    width: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    color: inherit !important;
    background: transparent !important;

    font-size: inherit !important;
    line-height: 40px !important;
    vertical-align: top !important;
}

/*
 * The prior custom rail is no longer present in the DOM. Neutralize its
 * selectors defensively so future markup changes cannot create a second
 * competing navigation style.
 */
.studio-navigation {
    display: none !important;
}

/* === MPAS EXACT WRF ICON BAR END === */


/* === MPAS WRF SIDEBAR ARCHITECTURE FIX START === */

.mpas-config-editors-card {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
}

.mpas-config-editor-row {
    display: grid;
    grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.8fr);
    gap: 0.25rem 0.6rem;
    align-items: baseline;

    padding: 0.28rem 0;
    border-top: 1px solid #e2e6ea;

    font-size: 0.875rem;
    line-height: 1.35;
}

.mpas-config-editor-row:first-of-type {
    border-top: 0;
}

.mpas-config-editor-row span {
    min-width: 0;
    color: #6c757d;
    overflow-wrap: anywhere;
}

.mpas-geographic-files-intro {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0.75rem !important;

    font-size: 0.875rem !important;
    line-height: 1.45 !important;
}

.mpas-geographic-files-intro p {
    margin-bottom: 0.75rem !important;
}

.mpas-geographic-files-intro p:last-child {
    margin-bottom: 0 !important;
}

.mpas-settings-card {
    margin-top: 0 !important;
}

/* === MPAS WRF SIDEBAR ARCHITECTURE FIX END === */


/* === MPAS GEOGRAPHIC FILES + SETTINGS FINAL START === */

.mpas-geographic-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mpas-geographic-file-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.32rem 0.42rem;
    margin-bottom: 0.3rem;
    border: 1px solid #d7dee5;
    border-radius: 3px;
    background: #fff;
    font-size: 0.875rem;
}

.mpas-geographic-file-row label {
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mpas-geographic-file-remove-one {
    padding: 0.1rem 0.3rem !important;
    line-height: 1 !important;
}

.mpas-map-settings {
    min-height: calc(100% - 0.5rem);
    padding-bottom: 44px;
}

.mpas-map-settings .form-check {
    margin-bottom: 0.35rem;
}

.mpas-map-settings .form-check-label {
    font-size: 1rem !important;
}

.mpas-settings-bottom {
    right: 10px !important;
    bottom: 10px !important;
    left: auto !important;
    width: auto !important;
}

/* === MPAS GEOGRAPHIC FILES + SETTINGS FINAL END === */


/* === MPAS SETTINGS BOTTOM + ALL-VIEW GEOFILES START === */

/* Make the active Settings pane consume the full pane height so the Reset
 * control can live at the bottom exactly like the WRF sidebar workflow. */
#panel-settings.active {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
}

#panel-settings .mpas-map-settings {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    padding-bottom: 0 !important;
}

#panel-settings .mpas-settings-bottom {
    position: static !important;
    display: flex !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    width: 100% !important;
    margin: auto 0 0 !important;
    padding: 10px 0 0 !important;
}

/* === MPAS SETTINGS BOTTOM + ALL-VIEW GEOFILES END === */


/* === MPAS MESH M2 CATALOG UI START === */

.mpas-mesh-catalog-section,
.mpas-selected-mesh-panel {
    margin: 0 0 0.55rem 0;
    padding: 0 0 0.55rem 0;
    border-bottom: 1px solid #dee2e6;
}

.mpas-mesh-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.mpas-mesh-section-heading h2,
.mpas-selected-mesh-subsection h3 {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
}

#mesh-selection-clear {
    padding: 0 !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
}

.mpas-mesh-catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(120px, 0.95fr);
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}

#mesh-catalog-message {
    min-height: 1.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.mpas-mesh-catalog-list {
    max-height: 255px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 3px;
    background: #fff;
}

.mpas-mesh-catalog-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: center;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 0.38rem 0.45rem;
    border: 0;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0;
    background: #fff;
    color: #212529;
    text-align: left;
    cursor: pointer;
}

.mpas-mesh-catalog-row:last-child {
    border-bottom: 0;
}

.mpas-mesh-catalog-row:hover,
.mpas-mesh-catalog-row:focus {
    background: #f0f6fc;
    outline: none;
}

.mpas-mesh-catalog-row.active {
    background: #e6f2ff;
    box-shadow: inset 3px 0 0 #0074d9;
}

.mpas-mesh-row-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.mpas-mesh-row-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem !important;
}

.mpas-mesh-row-id {
    margin-top: 0.08rem;
    color: #6c757d;
    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;
    font-size: 0.72rem;
}

.mpas-mesh-row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: #6c757d;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
}

.mpas-mesh-catalog-empty {
    padding: 0.75rem;
}

.mpas-selected-mesh-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.mpas-selected-mesh-title strong {
    font-size: 0.95rem !important;
}

.mpas-selected-mesh-title code {
    color: #495057;
    font-size: 0.75rem;
    white-space: nowrap;
}

.mpas-selected-mesh-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.15rem 0.65rem;
    margin: 0 0 0.45rem 0;
    font-size: 0.8rem;
}

.mpas-selected-mesh-grid > div {
    display: grid;
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
    gap: 0.35rem;
    align-items: baseline;
    padding: 0.1rem 0;
}

.mpas-selected-mesh-grid dt,
.mpas-selected-mesh-grid dd {
    margin: 0;
}

.mpas-selected-mesh-grid dt {
    font-weight: 600;
}

.mpas-selected-mesh-grid dd {
    min-width: 0;
    color: #495057;
    text-align: right;
    overflow-wrap: anywhere;
}

.mpas-selected-mesh-global-note {
    margin: 0.4rem 0 !important;
    padding: 0.45rem 0.55rem !important;
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
}

.mpas-selected-mesh-subsection {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid #e9ecef;
}

.mpas-selected-mesh-subsection h3 {
    margin-bottom: 0.35rem !important;
    font-size: 0.875rem !important;
}

.mpas-mesh-rule {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem;
    align-items: start;
    padding: 0.3rem 0;
    border-top: 1px dotted #dee2e6;
    font-size: 0.76rem;
    line-height: 1.35;
}

.mpas-mesh-rule:first-of-type {
    border-top: 0;
}

.mpas-mesh-rule-heading .badge {
    min-width: 52px;
    font-size: 0.66rem;
    font-weight: 600;
}

.mpas-selected-mesh-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mpas-selected-mesh-downloads .btn {
    font-size: 0.75rem !important;
}

.mpas-mesh-target-line {
    margin: 0 0 0.55rem 0;
    padding: 0.35rem 0.45rem;
    border: 1px solid #d7dee5;
    border-radius: 3px;
    background: #f8f9fa;
    font-size: 0.8rem;
}

.mpas-mesh-target-line #target-mpas-version {
    margin-left: 0.2rem;
    color: #6c757d;
}

@media (max-width: 575.98px) {
    .mpas-mesh-catalog-toolbar,
    .mpas-selected-mesh-grid {
        grid-template-columns: 1fr;
    }
}

/* === MPAS MESH M2 CATALOG UI END === */

/* === MPAS MESH M3A VISUALIZATION FRAMEWORK START === */
.mpas-mesh-preview-legend {
    box-sizing: border-box;
    max-width: 250px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    color: #222;
    font-size: 11px;
    line-height: 1.25;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
}

.mpas-mesh-preview-legend-title {
    margin-bottom: 2px;
    font-weight: 700;
    font-size: 12px;
}

.mpas-mesh-preview-legend-id {
    margin-bottom: 3px;
    color: #555;
    font-family: monospace;
    font-size: 10px;
}

.mpas-mesh-preview-legend-meta {
    margin-bottom: 3px;
}

.mpas-mesh-preview-legend-phase {
    color: #666;
    font-size: 10px;
}

.mpas-mesh-preview-globe-legend {
    position: absolute;
    right: 12px;
    bottom: 48px;
    z-index: 950;
}
/* === MPAS MESH M3A VISUALIZATION FRAMEWORK END === */

/* === MPAS M3c HFUN REFERENCE VISUALIZATION START === */

/*
 * M3c shows source-backed HFUN reference geometry only.
 * These controls deliberately say "reference" and "not an official
 * mesh footprint" so tutorial geometry cannot be mistaken for the
 * exact distributed MPAS mesh.
 */
.mpas-hfun-preview-legend {
    min-width: 230px;
    max-width: 310px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.34);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
    color: #263238;
    font-size: 11px;
    line-height: 1.35;
}

.mpas-hfun-preview-title {
    margin-bottom: 2px;
    font-weight: 700;
    font-size: 12px;
}

.mpas-hfun-preview-source {
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.mpas-hfun-preview-caveat {
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    color: #6c757d;
    font-style: italic;
}

.mpas-hfun-preview-globe-legend {
    position: absolute;
    left: 12px;
    bottom: 46px;
    z-index: 950;
    pointer-events: none;
}

/* Keep the existing selected-mesh M3a legend and the M3c HFUN
 * reference legend on opposite sides of the map/globe. */
body[data-map-view="globe"] .mpas-hfun-preview-globe-legend {
    display: block;
}

/* === MPAS M3c HFUN REFERENCE VISUALIZATION END === */

/* === MPAS WRF-STYLE UI ERROR REPORTING START === */

.mpas-ui-error-log-fixed-button {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 4901;
    padding: 5px 10px;
    border: 1px solid #a71d2a;
    border-radius: 4px;
    background: #dc3545;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0.35rem 0.8rem rgba(0, 0, 0, 0.25);
}

.mpas-ui-error-log-panel {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 54px;
    transform: translateX(-50%);
    z-index: 5000;
    width: min(980px, calc(100vw - 32px));
    max-height: min(540px, calc(100vh - 90px));
    border: 1px solid #343a40;
    border-radius: 5px;
    background: #212529;
    box-shadow: 0 0.7rem 2rem rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.mpas-ui-error-log-panel.visible {
    display: block;
}

.mpas-ui-error-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: #343a40;
    color: #fff;
}

.mpas-ui-error-log-title {
    font-weight: 700;
}

.mpas-ui-error-log-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.mpas-ui-error-log-actions button,
.mpas-error-report-buttons button {
    padding: 4px 8px;
    border: 1px solid #adb5bd;
    border-radius: 3px;
    background: #fff;
    color: #212529;
    font-size: 11px;
    cursor: pointer;
}

.mpas-ui-error-log-actions button:hover,
.mpas-error-report-buttons button:hover {
    background: #e9ecef;
}

.mpas-ui-error-log-body {
    margin: 0;
    padding: 10px;
    max-height: 430px;
    overflow: auto;
    background: #111;
    color: #e9ecef;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mpas-error-report-overlay {
    position: fixed;
    inset: 0;
    z-index: 5100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
}

.mpas-error-report-dialog {
    width: min(760px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid #a94442;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 0.8rem 2.5rem rgba(0, 0, 0, 0.5);
}

.mpas-error-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #a94442;
    background: #d9a097;
    color: #5b1712;
}

.mpas-error-report-header h5 {
    margin: 0;
}

#mpas-error-report-close {
    border: 0;
    background: transparent;
    color: #5b1712;
    font-size: 24px;
    cursor: pointer;
}

.mpas-error-report-body {
    padding: 14px 16px 16px;
}

.mpas-error-report-body label {
    display: block;
    margin: 8px 0 4px;
}

#mpas-error-report-details,
#mpas-error-report-repro {
    display: block;
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 7px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    box-sizing: border-box;
}

#mpas-error-report-repro {
    min-height: 90px;
}

.mpas-error-report-validation {
    margin-top: 5px;
    color: #b02a37;
    font-size: 12px;
}

.mpas-error-report-buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.mpas-error-report-buttons button.primary {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

.mpas-error-report-note {
    margin: 10px 0 0;
    color: #6c757d;
    font-size: 11px;
}

/* === MPAS WRF-STYLE UI ERROR REPORTING END === */

/* === MPAS MESH M3D INTERACTIVE REFINEMENT DESIGNER START === */

.mpas-hfun-designer-panel {
    margin: 0 0 0.55rem 0;
    padding: 0 0 0.65rem 0;
    border-bottom: 1px solid #dee2e6;
}

.mpas-hfun-designer-intro {
    margin-bottom: 0.45rem;
}

.mpas-hfun-designer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.5rem;
}

.mpas-hfun-designer-grid label {
    margin: 0;
    font-size: 0.74rem;
    color: #495057;
}

.mpas-hfun-designer-grid .form-control {
    margin-top: 0.15rem;
}

.mpas-hfun-designer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.55rem;
}

.mpas-hfun-designer-actions .btn {
    font-size: 0.72rem !important;
}

#hfun-design-pick-center.active {
    border-color: #0d6efd;
    background: #e7f1ff;
    color: #0b5ed7;
}

.mpas-hfun-design-message {
    min-height: 1.25rem;
    margin-top: 0.45rem;
    line-height: 1.3;
}

.mpas-hfun-diagnostics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.45rem;
    margin-top: 0.45rem;
}

.mpas-hfun-diagnostics > div {
    padding: 0.32rem 0.4rem;
    border: 1px solid #e1e5e9;
    border-radius: 3px;
    background: #f8f9fa;
}

.mpas-hfun-diagnostics span,
.mpas-hfun-diagnostics strong {
    display: block;
}

.mpas-hfun-diagnostics span {
    color: #6c757d;
    font-size: 0.68rem;
}

.mpas-hfun-diagnostics strong {
    margin-top: 0.08rem;
    color: #212529;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .mpas-hfun-designer-grid,
    .mpas-hfun-diagnostics {
        grid-template-columns: 1fr;
    }
}

/* === MPAS MESH M3D INTERACTIVE REFINEMENT DESIGNER END === */

/* === MPAS M3D SEARCHABLE OFFICIAL MESH DROPDOWN START === */

.mpas-mesh-catalog-toolbar,
.mpas-mesh-catalog-list {
    display: none !important;
}

.mpas-mesh-combobox {
    position: relative;
    margin-bottom: 0.35rem;
}

.mpas-mesh-combobox-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.mpas-mesh-combobox-control input {
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.mpas-mesh-combobox-control button {
    width: 32px;
    padding: 0;
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.mpas-mesh-combobox-control button i {
    transition: transform 120ms ease;
}

.mpas-mesh-combobox-control button.open i {
    transform: rotate(180deg);
}

.mpas-mesh-combobox-popup {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 2px);
    right: 0;
    left: 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #adb5bd;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.mpas-mesh-combobox-popup[hidden] {
    display: none !important;
}

.mpas-mesh-combobox-group {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.28rem 0.45rem;
    border-top: 1px solid #e6e9ec;
    border-bottom: 1px solid #e6e9ec;
    background: #f1f3f5;
    color: #495057;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mpas-mesh-combobox-group:first-child {
    border-top: 0;
}

.mpas-mesh-combobox-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 0.3rem 0.45rem;
    border: 0;
    border-bottom: 1px solid #edf0f2;
    background: #fff;
    color: #212529;
    text-align: left;
    cursor: pointer;
}

.mpas-mesh-combobox-option:last-child {
    border-bottom: 0;
}

.mpas-mesh-combobox-option:hover,
.mpas-mesh-combobox-option.active,
.mpas-mesh-combobox-option[aria-selected="true"] {
    background: #e7f1ff;
}

.mpas-mesh-combobox-option-title {
    min-width: 0;
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mpas-mesh-combobox-option-meta {
    margin-left: 0.5rem;
    color: #6c757d;
    font-family: monospace;
    font-size: 0.67rem;
    white-space: nowrap;
}

.mpas-mesh-combobox-empty {
    padding: 0.55rem;
    color: #6c757d;
    font-size: 0.75rem;
}

.mpas-mesh-catalog-section {
    overflow: visible;
}

/* === MPAS M3D SEARCHABLE OFFICIAL MESH DROPDOWN END === */

/* === MPAS M3D OFFICIAL MESH SEARCH + ICON BUTTONS START === */
.mpas-mesh-combobox-option{grid-template-columns:30px minmax(0,1fr) auto;gap:.32rem;padding:.25rem .35rem}
.mpas-mesh-combobox-option-icon{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;margin:0;padding:0;border:1px solid #c8cfd6;border-radius:4px;background:#f8f9fa;color:#495057;font-size:.72rem;line-height:1;cursor:pointer}
.mpas-mesh-combobox-option-icon:hover,.mpas-mesh-combobox-option-icon:focus{border-color:#0074d9;background:#0074d9;color:#fff;outline:none}
.mpas-mesh-combobox-option-icon.is-variable,.mpas-mesh-combobox-option-icon.is-circular,.mpas-mesh-combobox-option-icon.is-elliptical,.mpas-mesh-combobox-option-icon.is-tropical{border-color:#a9bfd4}
.mpas-mesh-combobox-option-icon.is-elliptical i{transform:scaleX(1.35)}
.mpas-mesh-combobox-option-title-button{display:block;min-width:0;width:100%;margin:0;padding:.22rem .15rem;overflow:hidden;border:0;border-radius:3px;background:transparent;color:#212529;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.mpas-mesh-combobox-option-title-button:hover,.mpas-mesh-combobox-option-title-button:focus{background:rgba(0,116,217,.08);color:#0056a6;outline:none;text-decoration:underline}
.mpas-mesh-combobox-option.active .mpas-mesh-combobox-option-icon,.mpas-mesh-combobox-option[aria-selected="true"] .mpas-mesh-combobox-option-icon{border-color:#0074d9}
.mpas-mesh-combobox-option.active .mpas-mesh-combobox-option-title-button,.mpas-mesh-combobox-option[aria-selected="true"] .mpas-mesh-combobox-option-title-button{color:#0056a6;font-weight:700}
/* === MPAS M3D OFFICIAL MESH SEARCH + ICON BUTTONS END === */

/* === MPAS M3D OFFICIAL MESH SPECKLE FIX START === */

.mpas-official-mesh-visualization-controls {
    margin: 0.45rem 0 0 0;
    padding: 0.4rem 0.45rem;
    border: 1px solid #d8dee4;
    border-radius: 3px;
    background: #f8f9fa;
}

.mpas-official-mesh-grid-toggle {
    width: 100%;
    margin: 0 0 0.4rem 0;
}

.mpas-official-mesh-cell-center-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: #343a40;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.mpas-official-mesh-cell-center-toggle input {
    margin: 0;
}

.mpas-official-mesh-visualization-note {
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.72rem;
    line-height: 1.25;
}

/* === MPAS M3D OFFICIAL MESH SPECKLE FIX END === */

/* === MPAS CONFIGURATION BROWSER M5B START === */

.mpas-config-panel {
    padding-bottom: 0.75rem;
}

.mpas-config-intro {
    margin-bottom: 0.65rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #dee2e6;
}

.mpas-config-intro strong {
    display: block;
    margin-bottom: 0.2rem;
}

.mpas-config-intro p {
    margin: 0;
    color: #6c757d;
    font-size: 0.84rem;
    line-height: 1.4;
}

.mpas-config-toolbar {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.mpas-config-toolbar [data-config-search],
.mpas-config-toolbar-actions {
    grid-column: 1 / -1;
}

.mpas-config-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.mpas-config-toolbar-actions [data-config-reset-core] {
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .mpas-config-toolbar {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-config-toolbar [data-config-search],
    .mpas-config-toolbar-actions {
        grid-column: auto;
    }

    .mpas-config-toolbar-actions
        [data-config-reset-core] {
        margin-left: 0;
    }
}

.mpas-config-summary {
    margin-bottom: 0.55rem;
    color: #6c757d;
    font-size: 0.78rem;
    line-height: 1.35;
}

.mpas-config-record {
    margin-bottom: 0.45rem;
    border: 1px solid #d7e0e6;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.82);
}

.mpas-config-record-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.48rem 0.55rem;
    cursor: pointer;
    user-select: none;
    background: #f8fbfd;
}

.mpas-config-record-summary:hover {
    background: #eef6fb;
}

.mpas-config-record-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #343a40;
    font-size: 0.86rem;
    font-weight: 600;
}

.mpas-config-record-options {
    padding: 0.42rem;
    border-top: 1px solid #e2e8ed;
}

.mpas-config-option {
    margin-bottom: 0.35rem;
    border: 1px solid #e0e5e9;
    border-radius: 3px;
    background: #fff;
}

.mpas-config-option:last-child {
    margin-bottom: 0;
}

.mpas-config-option-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.42rem 0.48rem;
    cursor: pointer;
}

.mpas-config-option-summary:hover {
    background: #fafcfd;
}

.mpas-config-option-identity {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
}

.mpas-config-option-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.8rem;
}

.mpas-config-type-badge,
.mpas-config-status-badge {
    flex: 0 0 auto;
    font-size: 0.66rem;
}

.mpas-config-option-body {
    padding: 0.48rem;
    border-top: 1px solid #edf0f2;
    background: #fcfdfe;
}

.mpas-config-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.42rem;
}

.mpas-config-field {
    min-width: 0;
}

.mpas-config-wide-field,
.mpas-config-source-field {
    grid-column: 1 / -1;
}

.mpas-config-field-label {
    margin-bottom: 0.08rem;
    color: #6c757d;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mpas-config-field-value {
    overflow-wrap: anywhere;
    color: #343a40;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-config-field-value a {
    overflow-wrap: anywhere;
}

.mpas-config-description {
    margin: 0.5rem 0 0;
    padding-top: 0.45rem;
    border-top: 1px solid #edf0f2;
    color: #495057;
    font-size: 0.78rem;
    line-height: 1.42;
}

.mpas-config-empty {
    margin-bottom: 0;
    padding: 0.55rem;
    font-size: 0.82rem;
}

@media (max-width: 575.98px) {
    .mpas-config-field-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpas-config-wide-field,
    .mpas-config-source-field {
        grid-column: auto;
    }
}

/* === MPAS CONFIGURATION BROWSER M5B END === */

/* === MPAS CONFIGURATION EDITOR M5D.2 START === */

.mpas-config-editor-option {
    margin-bottom: 0.38rem;
    padding: 0.42rem;
    border: 1px solid #e0e5e9;
    border-radius: 3px;
    background: #fff;
}

.mpas-config-editor-option:last-child {
    margin-bottom: 0;
}

.mpas-config-editor-option.is-omitted {
    background: #fafbfc;
}

.mpas-config-editor-option.is-dirty {
    border-color: #d7b94b;
    box-shadow: inset 3px 0 0 #ffc107;
}

.mpas-config-editor-option.is-pending {
    border-color: #7abaff;
    box-shadow: inset 3px 0 0 #007bff;
}

.mpas-config-editor-option:focus {
    outline: 2px solid rgba(0, 123, 255, 0.45);
    outline-offset: 2px;
}

.mpas-config-editor-option-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.mpas-config-editor-include {
    display: inline-flex;
    min-width: 0;
    gap: 0.35rem;
    align-items: flex-start;
    margin: 0;
    cursor: pointer;
}

.mpas-config-editor-include input {
    flex: 0 0 auto;
    margin-top: 0.18rem;
}

.mpas-config-editor-option-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
}

.mpas-config-editor-badges {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.2rem;
}

.mpas-config-editor-badges .badge {
    font-size: 0.62rem;
}

.mpas-config-editor-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.38rem;
}

.mpas-config-editor-value {
    min-width: 0;
    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;
    font-size: 0.74rem !important;
}

.mpas-config-editor-note {
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.68rem;
    line-height: 1.3;
}

.mpas-config-editor-metadata {
    margin-top: 0.3rem;
    padding-top: 0.25rem;
    border-top: 1px dotted #dee2e6;
}

.mpas-config-editor-metadata > summary {
    color: #5f6b75;
    font-size: 0.68rem;
    cursor: pointer;
}

.mpas-config-editor-metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.32rem 0.42rem;
    margin-top: 0.3rem;
}

.mpas-config-editor-meta-field {
    min-width: 0;
}

.mpas-config-editor-meta-label {
    color: #6c757d;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mpas-config-editor-meta-value {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #343a40;
    font-size: 0.68rem;
    line-height: 1.3;
}

.mpas-config-panel[data-config-mode="editor"] [data-config-reset-core] {
    margin-top: 0.4rem;
}

@media (max-width: 575.98px) {
    .mpas-config-editor-controls,
    .mpas-config-editor-metadata-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpas-config-editor-controls .btn {
        justify-self: start;
    }
}

/* === MPAS CONFIGURATION EDITOR M5D.2 END === */

/* === MPAS CONFIGURATION MODAL + RICH METADATA M5D.3B2 START === */

.mpas-config-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1980;
    background: rgba(0, 0, 0, 0.48);
}

.mpas-config-modal-backdrop[hidden] {
    display: none !important;
}

.mpas-config-modal-panel {
    position: fixed;
    z-index: 1990;
    top: 3vh;
    left: 3vw;
    width: 94vw;
    height: 94vh;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #cfd7de;
    border-radius: 0.45rem;
    background: #fff;
    box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.28);
}

.mpas-config-modal-panel.active {
    display: flex;
    flex-direction: column;
}

.mpas-config-modal-panel .mpas-config-intro {
    display: none;
}

.mpas-config-modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem 0.7rem;
    border-bottom: 1px solid #d8e0e6;
    background: #f8fafc;
}

.mpas-config-modal-heading {
    min-width: 0;
}

.mpas-config-modal-title {
    margin: 0;
    color: #2f3840;
    font-size: 1.25rem;
    font-weight: 500;
}

.mpas-config-modal-subtitle {
    margin-top: 0.2rem;
    color: #6c757d;
    font-size: 0.78rem;
}

.mpas-config-modal-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1.7rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.mpas-config-modal-close:hover,
.mpas-config-modal-close:focus {
    color: #343a40;
    outline: none;
}

.mpas-config-modal-panel .mpas-config-toolbar {
    grid-template-columns:
        minmax(16rem, 1.35fr)
        minmax(14rem, 0.8fr)
        auto;
    flex: 0 0 auto;
    gap: 0.55rem;
    align-items: center;
    margin: 0;
    padding: 0.75rem 1rem 0.45rem;
    border-bottom: 0;
}

.mpas-config-modal-panel .mpas-config-panel[data-config-mode="editor"] [data-config-reset-core],
.mpas-config-modal-panel[data-config-mode="editor"] [data-config-reset-core] {
    margin-top: 0;
    white-space: nowrap;
}

.mpas-config-modal-panel .mpas-config-summary {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 1rem 0.65rem;
    border-bottom: 1px solid #e1e6ea;
}

.mpas-config-modal-panel .mpas-config-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.8rem 1rem 1rem;
    background: #fff;
}

.mpas-config-modal-panel .mpas-config-record {
    margin-bottom: 0.7rem;
}

.mpas-config-modal-panel .mpas-config-record-summary {
    padding: 0.58rem 0.7rem;
}

.mpas-config-modal-panel .mpas-config-record-name {
    font-size: 0.9rem;
}

.mpas-config-modal-panel .mpas-config-editor-option {
    display: grid;
    grid-template-columns:
        minmax(15rem, 19rem)
        minmax(14rem, 19rem)
        minmax(24rem, 1fr);
    grid-template-rows: auto auto;
    column-gap: 1rem;
    row-gap: 0.28rem;
    align-items: start;
    margin: -1px 0 0;
    padding: 0.75rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
}

.mpas-config-modal-panel .mpas-config-editor-option:first-child {
    margin-top: 0;
    border-top: 0;
}

.mpas-config-modal-panel .mpas-config-editor-option-header {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-width: 0;
    padding: 0.4rem 0.5rem;
    border: 1px solid #d7dde2;
    background: #eef1f3;
}



.mpas-config-modal-panel .mpas-config-editor-option-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.mpas-config-modal-panel .mpas-config-editor-badges {
    margin-left: 0.4rem;
}

.mpas-config-modal-panel .mpas-config-editor-controls {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
}

.mpas-config-modal-panel .mpas-config-editor-note {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
}

.mpas-config-modal-panel .mpas-config-editor-metadata {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-width: 0;
    margin: 0;
    padding: 0.1rem 0;
    border-top: 0;
}

.mpas-config-editor-doc-description {
    color: #3e4851;
    font-size: 0.8rem;
    line-height: 1.42;
}

.mpas-config-editor-doc-type {
    margin-top: 0.18rem;
    color: #6c757d;
    font-size: 0.7rem;
}

.mpas-config-editor-choice-list {
    margin-top: 0.45rem;
}

.mpas-config-editor-choice-label {
    color: #6c757d;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mpas-config-editor-choice-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.18rem;
}

.mpas-config-editor-choice {
    padding: 0.1rem 0.35rem;
    border: 1px solid #d7dde2;
    border-radius: 0.25rem;
    background: #f8f9fa;
    color: #495057;
    font-size: 0.7rem;
}

.mpas-config-modal-panel .mpas-config-editor-metadata-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    margin-top: 0.5rem;
}

.mpas-config-modal-panel .mpas-config-editor-meta-field.is-wide {
    grid-column: 1 / -1;
}

.mpas-config-modal-panel .mpas-config-editor-meta-label {
    font-size: 0.62rem;
}

.mpas-config-modal-panel .mpas-config-editor-meta-value {
    font-size: 0.7rem;
}

.mpas-config-editor-provenance {
    margin-top: 0.45rem;
    padding-top: 0.35rem;
    border-top: 1px dotted #d8dee3;
    color: #5f6b75;
    font-size: 0.68rem;
}

.mpas-config-editor-provenance > summary {
    cursor: pointer;
}

.mpas-config-editor-provenance-body {
    margin-top: 0.3rem;
}

.mpas-config-editor-provenance-line {
    margin-top: 0.16rem;
    overflow-wrap: anywhere;
}

.mpas-config-editor-provenance-line:first-child {
    margin-top: 0;
}

@media (max-width: 1199.98px) {
    .mpas-config-modal-panel .mpas-config-editor-option {
        grid-template-columns:
            minmax(14rem, 18rem)
            minmax(0, 1fr);
    }

    .mpas-config-modal-panel .mpas-config-editor-option-header {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .mpas-config-modal-panel .mpas-config-editor-controls {
        grid-column: 2;
        grid-row: 1;
    }

    .mpas-config-modal-panel .mpas-config-editor-note {
        grid-column: 2;
        grid-row: 2;
    }

    .mpas-config-modal-panel .mpas-config-editor-metadata {
        grid-column: 1 / -1;
        grid-row: 3;
        padding-top: 0.5rem;
        border-top: 1px solid #edf0f2;
    }
}

@media (max-width: 767.98px) {
    .mpas-config-modal-panel {
        top: 1vh;
        left: 1vw;
        width: 98vw;
        height: 98vh;
    }



    .mpas-config-modal-panel .mpas-config-editor-option {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpas-config-modal-panel .mpas-config-editor-option-header,
    .mpas-config-modal-panel .mpas-config-editor-controls,
    .mpas-config-modal-panel .mpas-config-editor-note,
    .mpas-config-modal-panel .mpas-config-editor-metadata {
        grid-column: 1;
        grid-row: auto;
    }

    .mpas-config-modal-panel .mpas-config-editor-metadata {
        padding-top: 0.5rem;
    }

    .mpas-config-modal-panel .mpas-config-editor-metadata-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpas-config-modal-panel .mpas-config-editor-meta-field.is-wide {
        grid-column: 1;
    }
}

/* === MPAS CONFIGURATION MODAL + RICH METADATA M5D.3B2 END === */

/* === MPAS CONFIGURATION WRF-LIKE ACTIONS M5D.3B3 START === */

.mpas-config-modal-panel .mpas-config-toolbar {
    grid-template-columns:
        minmax(16rem, 1.4fr)
        minmax(14rem, 0.8fr);
}

.mpas-config-modal-panel .mpas-config-toolbar [data-config-reset-core] {
    display: none;
}

.mpas-config-modal-panel .mpas-config-results {
    padding-right: 4.25rem;
}

.mpas-config-editor-choice {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.12rem 0.38rem;
    border: 1px solid #cfd7de;
    border-radius: 0.25rem;
    background: #f8f9fa;
    color: #495057;
    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;
    font-size: 0.7rem;
    line-height: 1.25;
    cursor: pointer;
}

.mpas-config-editor-choice:hover {
    border-color: #6caee0;
    background: #eaf5fd;
    color: #0069b4;
}

.mpas-config-editor-choice:focus {
    outline: 2px solid rgba(0, 123, 255, 0.28);
    outline-offset: 1px;
}

.mpas-config-scroll-dock {
    position: absolute;
    z-index: 5;
    right: 0.85rem;
    bottom: 4.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.mpas-config-scroll-button {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #68737c;
    color: #fff;
    box-shadow: 0 0.2rem 0.55rem rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.mpas-config-scroll-button:hover,
.mpas-config-scroll-button:focus {
    background: #4d5962;
    color: #fff;
    outline: none;
}

.mpas-config-modal-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    border-top: 1px solid #d8e0e6;
    background: #f8fafc;
}



.mpas-config-modal-footer .btn i {
    margin-right: 0.15rem;
}

@media (max-width: 767.98px) {
    .mpas-config-modal-panel .mpas-config-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpas-config-modal-panel .mpas-config-results {
        padding-right: 3.5rem;
    }

    .mpas-config-scroll-dock {
        right: 0.55rem;
        bottom: 4.9rem;
    }

    .mpas-config-modal-footer-left,
    .mpas-config-modal-footer-right {
        flex: 1 1 auto;
    }


}

/* === MPAS CONFIGURATION WRF-LIKE ACTIONS M5D.3B3 END === */

/* === MPAS NAMELIST EXPORT M5E.1 START === */

.mpas-config-export-status {
    min-width: 0;
    color: #6c757d;
    font-size: 0.72rem;
    line-height: 1.25;
}

.mpas-config-export-status.is-error {
    color: #b21f2d;
}

.mpas-config-preview {
    position: absolute;
    z-index: 12;
    top: 4.45rem;
    right: 0.75rem;
    bottom: 3.55rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #cfd7de;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 0.5rem 1.4rem rgba(0, 0, 0, 0.14);
}

.mpas-config-preview[hidden] {
    display: none !important;
}

.mpas-config-preview-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #dde3e8;
    background: #f8fafc;
}

.mpas-config-preview-title {
    min-width: 0;
    margin: 0;
    color: #3b444c;
    font-size: 0.9rem;
    font-weight: 600;
}

.mpas-config-preview-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.mpas-config-preview-close:hover,
.mpas-config-preview-close:focus {
    color: #343a40;
    outline: none;
}

.mpas-config-preview-text {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    resize: none;
    border: 0;
    border-radius: 0;
    padding: 0.8rem;
    background: #fcfdfe;
    color: #212529;
    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre;
    tab-size: 4;
}

.mpas-config-preview-text:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.14);
}

.mpas-config-modal-footer-right .btn {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .mpas-config-preview {
        top: 4.2rem;
        right: 0.4rem;
        bottom: 4rem;
        left: 0.4rem;
    }

    .mpas-config-modal-footer {
        flex-wrap: wrap;
    }


}

/* === MPAS NAMELIST EXPORT M5E.1 END === */

/* === MPAS NAMELIST IMPORT M5E.2 START === */

.mpas-config-import-review {
    position: absolute;
    z-index: 14;
    top: 4.45rem;
    right: 0.75rem;
    bottom: 3.55rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #cfd7de;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 0.5rem 1.4rem rgba(0, 0, 0, 0.16);
}

.mpas-config-import-review[hidden] {
    display: none !important;
}

.mpas-config-import-review-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #dde3e8;
    background: #f8fafc;
}

.mpas-config-import-review-title {
    min-width: 0;
    margin: 0;
    color: #3b444c;
    font-size: 0.92rem;
    font-weight: 600;
}

.mpas-config-import-review-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.mpas-config-import-review-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.8rem;
}

.mpas-config-import-review-summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(8rem, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mpas-config-import-stat {
    padding: 0.5rem 0.6rem;
    border: 1px solid #dce2e8;
    border-radius: 0.3rem;
    background: #f8fafc;
}

.mpas-config-import-stat-label {
    color: #6c757d;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mpas-config-import-stat-value {
    margin-top: 0.12rem;
    color: #343a40;
    font-size: 0.95rem;
    font-weight: 600;
}

.mpas-config-import-message {
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #b8daff;
    border-radius: 0.3rem;
    background: #eaf5ff;
    color: #24557a;
    font-size: 0.76rem;
}

.mpas-config-import-message.is-blocked {
    border-color: #f1b0b7;
    background: #fbeaec;
    color: #842029;
}

.mpas-config-import-section {
    margin-top: 0.8rem;
}

.mpas-config-import-section:first-child {
    margin-top: 0;
}

.mpas-config-import-section-title {
    margin: 0 0 0.35rem;
    color: #495057;
    font-size: 0.78rem;
    font-weight: 700;
}

.mpas-config-import-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #495057;
    font-size: 0.73rem;
}

.mpas-config-import-list li + li {
    margin-top: 0.18rem;
}

.mpas-config-import-change-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.71rem;
}

.mpas-config-import-change-list th,
.mpas-config-import-change-list td {
    padding: 0.32rem 0.4rem;
    border-bottom: 1px solid #e6eaee;
    text-align: left;
    vertical-align: top;
}

.mpas-config-import-change-list th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #5d6872;
    font-weight: 700;
}

.mpas-config-import-review-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-top: 1px solid #d8e0e6;
    background: #f8fafc;
}

.mpas-config-import-replacement-note {
    max-width: 62%;
    color: #6c757d;
    font-size: 0.7rem;
    line-height: 1.3;
}

.mpas-config-import-review-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

@media (max-width: 767.98px) {
    .mpas-config-import-review {
        top: 4.2rem;
        right: 0.4rem;
        bottom: 4rem;
        left: 0.4rem;
    }

    .mpas-config-import-review-summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mpas-config-import-review-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .mpas-config-import-replacement-note {
        max-width: none;
    }
}

/* === MPAS NAMELIST IMPORT M5E.2 END === */






/* === MPAS UI REPAIR 5A OFFICIAL MESH RELOCATION START === */

.mpas-official-mesh-relocation-panel {
    margin: 0 0 0.55rem 0;
    padding: 0 0 0.65rem 0;
    border-bottom: 1px solid #dee2e6;
}

.mpas-official-relocation-intro {
    margin-bottom: 0.45rem;
}

.mpas-official-relocation-message {
    min-height: 1.25rem;
    margin-top: 0.45rem;
    line-height: 1.3;
}

#official-relocation-pick-center.active {
    border-color: #0d6efd;
    background: #e7f1ff;
    color: #0b5ed7;
}

.mpas-official-relocation-message[data-kind="warning"] {
    color: #856404 !important;
}

/* === MPAS UI REPAIR 5A OFFICIAL MESH RELOCATION END === */

/* === MPAS UI REPAIR 5A.3 ACTIVE MESH SOURCE START === */

.mpas-active-mesh-source-panel {
    margin: 0 0 0.55rem 0;
    padding: 0 0 0.65rem 0;
    border-bottom: 1px solid #dee2e6;
}

.mpas-active-mesh-source-intro {
    margin-bottom: 0.45rem;
}

.mpas-active-mesh-source-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.mpas-active-mesh-source-actions .btn {
    font-size: 0.72rem !important;
}

.mpas-active-mesh-source-actions .btn.active {
    font-weight: 600;
    box-shadow: inset 0 0 0 1px currentColor;
}

.mpas-active-mesh-source-message {
    min-height: 1.25rem;
    margin-top: 0.45rem;
    line-height: 1.3;
}

.mpas-active-mesh-source-message[data-kind="warning"] {
    color: #856404;
}

.mpas-active-mesh-source-message[data-kind="official"] {
    color: #0b5ed7;
}

.mpas-active-mesh-source-message[data-kind="custom"] {
    color: #117a8b;
}

/* === MPAS UI REPAIR 5A.3 ACTIVE MESH SOURCE END === */

/* === MPAS / WRF CONFIGURATION THEME PARITY M5F.1 START === */
/*
 * Visual parity source: WRFConfigurationStudio/styles/wrf-domain-wizard.css
 * Current WRF namelist editor palette:
 *   text          #212529 / #495057 / #5c6770
 *   shell         #ffffff
 *   header/footer #f8fafc
 *   group header  #f7f9fb
 *   borders       #e5e9ef / #e9edf2 / #d7dee7
 *   primary       #0d6efd
 *   focus         #86b7fe + rgba(13, 110, 253, 0.12)
 */

.mpas-config-modal-subtitle,
.mpas-config-editor-note,
.mpas-config-editor-doc-type,
.mpas-config-editor-meta-label,
.mpas-config-editor-provenance,
.mpas-config-export-status,
.mpas-config-import-replacement-note {
    color: #5c6770;
}

.mpas-config-modal-panel .mpas-config-toolbar .form-control,
.mpas-config-modal-panel .mpas-config-editor-value,
.mpas-config-preview-text {
    color: #212529;
    background-color: #ffffff;
    border-color: #d7dee7;
    box-shadow: none;
}

.mpas-config-modal-panel .mpas-config-toolbar .form-control:focus,
.mpas-config-modal-panel .mpas-config-editor-value:focus,
.mpas-config-preview-text:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.16rem rgba(13, 110, 253, 0.12);
}



.mpas-config-modal-panel .mpas-config-editor-option {
    border-color: #f1f3f5;
    background: #ffffff;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}







.mpas-config-modal-panel .mpas-config-editor-option-header {
    color: #495057;
    background: #e9ecef;
    border-color: #ced4da;
}

.mpas-config-modal-panel .mpas-config-editor-option-name {
    color: #1f2933 !important;
    background: transparent !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.mpas-config-modal-panel
.mpas-config-editor-include
input[type="checkbox"] {
    accent-color: #0d6efd;
}

.mpas-config-modal-panel .mpas-config-editor-badges .badge-success {
    color: #246b36;
    background: #e3f3e7;
    border: 1px solid #c6e5cd;
}

.mpas-config-modal-panel .mpas-config-editor-badges .badge-secondary {
    color: #495057;
    background: #eef2f6;
    border: 1px solid #dfe5eb;
}

.mpas-config-modal-panel .mpas-config-editor-badges .badge-warning {
    color: #664d03;
    background: #fff3cd;
    border: 1px solid #ffecb5;
}

.mpas-config-editor-doc-description,
.mpas-config-editor-meta-value {
    color: #495057;
}

.mpas-config-editor-choice {
    color: #495057;
    background: #f8f9fa;
    border-color: #d7dee7;
}

.mpas-config-editor-choice:hover {
    color: #0d6efd;
    background: #f0f6ff;
    border-color: #86b7fe;
}

.mpas-config-editor-choice:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.16rem rgba(13, 110, 253, 0.12);
}

.mpas-config-editor-provenance {
    border-top-color: #e5e9ef;
}

.mpas-config-editor-provenance a {
    color: #0d6efd;
}

.mpas-config-modal-footer,
.mpas-config-preview-header,
.mpas-config-import-review-header,
.mpas-config-import-review-footer {
    background: #f8fafc;
    border-color: #e5e9ef;
}

.mpas-config-preview,
.mpas-config-import-review {
    color: #212529;
    background: #ffffff;
    border-color: #e5e9ef;
    border-radius: 12px;
}

.mpas-config-preview-title,
.mpas-config-import-review-title,
.mpas-config-import-section-title {
    color: #212529;
}

.mpas-config-preview-text {
    background: #fbfdff;
}

.mpas-config-import-stat {
    background: #f7f9fb;
    border-color: #e9edf2;
}

.mpas-config-import-stat-label {
    color: #5c6770;
}

.mpas-config-import-stat-value {
    color: #212529;
}

.mpas-config-import-change-list th {
    color: #495057;
    background: #f7f9fb;
}

.mpas-config-import-change-list th,
.mpas-config-import-change-list td {
    border-bottom-color: #e9edf2;
}

.mpas-config-import-list,
.mpas-config-import-change-list td {
    color: #495057;
}

.mpas-config-import-message {
    color: #24557a;
    background: #eaf5ff;
    border-color: #b8daff;
}

.mpas-config-import-message.is-blocked {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
}

.mpas-config-scroll-button {
    color: #ffffff;
    background: #6c757d;
}

.mpas-config-scroll-button:hover,
.mpas-config-scroll-button:focus {
    color: #ffffff;
    background: #5c636a;
}

.mpas-config-modal-panel .btn-primary,
.mpas-config-import-review .btn-primary {
    color: #ffffff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.mpas-config-modal-panel .btn-primary:hover,
.mpas-config-import-review .btn-primary:hover {
    color: #ffffff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.mpas-config-modal-panel .btn-outline-primary,
.mpas-config-import-review .btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.mpas-config-modal-panel .btn-outline-primary:hover,
.mpas-config-import-review .btn-outline-primary:hover {
    color: #ffffff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.mpas-config-modal-panel .btn-secondary,
.mpas-config-import-review .btn-secondary {
    color: #ffffff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.mpas-config-modal-panel .btn:disabled,
.mpas-config-modal-panel .btn.disabled,
.mpas-config-import-review .btn:disabled,
.mpas-config-import-review .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.mpas-config-modal-close,
.mpas-config-preview-close,
.mpas-config-import-review-close {
    color: #6c757d;
}

.mpas-config-modal-close:hover,
.mpas-config-modal-close:focus,
.mpas-config-preview-close:hover,
.mpas-config-preview-close:focus,
.mpas-config-import-review-close:hover,
.mpas-config-import-review-close:focus {
    color: #343a40;
}

/* === MPAS / WRF CONFIGURATION THEME PARITY M5F.1 END === */

/* === MPAS / WRF CONFIGURATION STRICT LAYOUT PARITY M5H.1B START === */
/*
 * Source-derived visual parity with:
 *
 * WRFConfigurationStudio/styles/wrf-domain-wizard.css
 *
 * Canonical WRF editor values intentionally mirrored here:
 *   modal radius       12px
 *   shell text         #212529
 *   muted text         #5c6770
 *   header/footer      #f8fafc
 *   record background  #ffffff
 *   record header      #f7f9fb
 *   record border      #e9edf2
 *   record radius      10px
 *   record spacing     14px
 *   field background   #e9ecef
 *   field border       #ced4da
 *   primary blue       #0d6efd
 *   focus blue         #86b7fe
 *   dirty background   #fff8db
 *   dirty border       #f0c419
 *
 * Presentation only. No MPAS configuration semantics are changed.
 */


/* ---------------------------------------------------------
 * Modal shell — mirrors WRF namelist modal
 * --------------------------------------------------------- */

.mpas-config-modal-panel {
    top: 3vh;
    left: 3vw;
    width: 94vw;
    height: 94vh;
    color: #212529;
    background: #ffffff;
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    overflow: hidden;
}

.mpas-config-modal-header {
    padding: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e9ef;
}

.mpas-config-modal-title {
    margin: 0;
    color: #212529;
    font-size: 1.25rem;
    font-weight: 500;
}

.mpas-config-modal-subtitle {
    margin-top: 0.18rem;
    color: #5c6770;
    font-size: 0.78rem;
}

.mpas-config-modal-close {
    color: #6c757d;
}


/* ---------------------------------------------------------
 * Toolbar — follows WRF search/jump toolbar dimensions
 * --------------------------------------------------------- */

.mpas-config-modal-panel .mpas-config-toolbar {
    display: grid;
    grid-template-columns:
        minmax(20rem, 1.8fr)
        minmax(15rem, 1fr)
        max-content;
    gap: 0.45rem;
    align-items: center;
    margin: 0;
    padding: 10px 12px 8px;

    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.98),
            rgba(255, 255, 255, 0.94)
        );

    border-bottom: 1px solid #edf1f5;
}

.mpas-config-modal-panel
.mpas-config-toolbar
[data-config-search] {
    grid-column: 1;
    grid-row: 1;
}

.mpas-config-modal-panel
.mpas-config-toolbar
[data-config-jump-record] {
    grid-column: 2;
    grid-row: 1;
}

/*
 * data-config-jump-option remains as an internal hidden navigation
 * target for Review Changes -> Go to option. It is intentionally
 * absent from the visible M7 toolbar.
 */
.mpas-config-modal-panel
.mpas-config-toolbar
[data-config-jump-option][hidden] {
    display: none !important;
}

.mpas-config-modal-panel
.mpas-config-toolbar-actions {
    grid-column: 3;
    grid-row: 1;

    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
}

.mpas-config-modal-panel
.mpas-config-toolbar
[data-config-status-filter] {
    grid-column: 1 / 2;
    grid-row: 2;
}

.mpas-config-modal-panel
.mpas-config-toolbar
[data-config-working-filter] {
    grid-column: 2 / 4;
    grid-row: 2;
}

.mpas-config-modal-panel
.mpas-config-toolbar
.form-control {
    min-height: 34px;
    height: 34px;

    padding: 0.25rem 0.5rem;

    color: #212529;
    background-color: #ffffff;
    border-color: #d7dee7;

    font-size: 0.875rem;
    line-height: 1.5;

    box-shadow: none;
}

.mpas-config-modal-panel
.mpas-config-toolbar
.form-control:focus {
    border-color: #86b7fe;

    box-shadow:
        0 0 0 0.16rem
        rgba(13, 110, 253, 0.12);
}

.mpas-config-modal-panel
.mpas-config-toolbar-actions
.btn {
    min-height: 34px;

    padding: 0.25rem 0.5rem;

    font-size: 0.875rem;
    line-height: 1.5;

    color: #495057;
    background: #ffffff;
    border-color: #ced4da;
}

.mpas-config-modal-panel
.mpas-config-toolbar-actions
.btn:hover {
    color: #212529;
    background: #f8f9fa;
    border-color: #adb5bd;
}


/* ---------------------------------------------------------
 * Summary — visually attached to toolbar like WRF
 * --------------------------------------------------------- */

.mpas-config-modal-panel .mpas-config-summary {
    margin: 0;

    padding:
        0.35rem
        12px
        0.55rem;

    color: #5c6770;
    background: #ffffff;

    border-bottom: 1px solid #edf1f5;

    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.35;
}


/* ---------------------------------------------------------
 * Scrollable record area
 * --------------------------------------------------------- */

.mpas-config-modal-panel .mpas-config-results {
    flex: 1 1 auto;
    min-height: 0;

    overflow: auto;

    padding:
        0.75rem
        4.25rem
        1rem
        0.75rem;

    background: #ffffff;
}


/* ---------------------------------------------------------
 * Record/group cards — direct WRF values
 * --------------------------------------------------------- */

.mpas-config-modal-panel .mpas-config-record {
    overflow: hidden;

    margin-bottom: 14px;

    border: 1px solid #e9edf2;
    border-radius: 10px;

    background: #ffffff;
}

.mpas-config-modal-panel
.mpas-config-record-summary {
    list-style: none;
}

.mpas-config-modal-panel
.mpas-config-record-summary::-webkit-details-marker {
    display: none;
}

.mpas-config-modal-panel
.mpas-config-record-summary::before {
    content: '▸';

    flex: 0 0 30px;

    width: 30px;

    color: #495057;

    font-size: 0.8rem;
    text-align: center;
}

.mpas-config-modal-panel
.mpas-config-record[open]
> .mpas-config-record-summary::before {
    content: '▾';
}

.mpas-config-modal-panel
.mpas-config-record-summary {
    display: flex;
    align-items: center;

    min-height: 42px;

    padding: 10px 12px;

    color: #212529;
    background: #f7f9fb;

    border-bottom: 1px solid transparent;
}

.mpas-config-modal-panel
.mpas-config-record-summary:hover {
    background: #f5f7f9;
}

.mpas-config-modal-panel
.mpas-config-record[open]
> .mpas-config-record-summary {
    border-bottom-color: #e9edf2;
}

.mpas-config-modal-panel
.mpas-config-record-name {
    color: #1f2933 !important;

    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.mpas-config-modal-panel
.mpas-config-record-summary
.badge-light {
    color: #495057;
    background: #eef2f6;

    border: 1px solid #e1e6ec;

    font-size: 65%;
}


/* ---------------------------------------------------------
 * Variable/option rows — use WRF table-like proportions
 * --------------------------------------------------------- */

.mpas-config-modal-panel
.mpas-config-record-options {
    padding: 0;
    border-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-option {
    display: grid;

    grid-template-columns:
        1.75rem
        minmax(15rem, 18rem)
        minmax(14rem, 18rem)
        minmax(24rem, 1fr);

    grid-template-rows:
        auto auto;

    column-gap: 1rem;
    row-gap: 0.3rem;

    align-items: start;

    margin: 0;
    padding: 10px 12px;

    border: 0;
    border-top: 1px solid #f1f3f5;
    border-radius: 0;

    background: #ffffff;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.mpas-config-modal-panel
.mpas-config-editor-option:first-child {
    border-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-option:hover {
    background: #fafcff;
}

.mpas-config-modal-panel
.mpas-config-editor-option.is-omitted {
    background: #fbfcfd;
}

.mpas-config-modal-panel
.mpas-config-editor-option.is-dirty {
    background: #fff8db;

    box-shadow:
        inset 4px 0 0 #f0c419;
}


/* ---------------------------------------------------------
 * WRF field-row column 1 — include checkbox
 * --------------------------------------------------------- */

.mpas-config-editor-toggle-cell {
    grid-column: 1;
    grid-row: 1;

    padding-top: 0.4rem;

    text-align: center;
}

.mpas-config-editor-toggle-cell
input[type="checkbox"] {
    margin: 0;

    accent-color: #0d6efd;
}


/* ---------------------------------------------------------
 * WRF field-row column 4 — source-backed documentation
 * --------------------------------------------------------- */

.mpas-config-editor-documentation {
    grid-column: 4;
    grid-row: 1 / span 2;

    min-width: 0;

    padding-top: 0.2rem;

    justify-self: stretch;
}

.mpas-config-editor-documentation
.mpas-config-editor-metadata {
    margin: 0;
    padding: 0;

    border-top: 0;
}


/* ---------------------------------------------------------
 * Variable identity block — mirrors WRF grey name field
 * --------------------------------------------------------- */

.mpas-config-modal-panel
.mpas-config-editor-option-header {
    grid-column: 2;
    grid-row: 1 / span 2;

    min-width: 0;

    padding: 0.25rem 0.5rem;

    color: #495057;
    background: #e9ecef;

    border: 1px solid #ced4da;
    border-radius: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-include {
    width: 100%;
}

.mpas-config-modal-panel
.mpas-config-editor-option-name {
    color: #1f2933 !important;

    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;

    letter-spacing: 0.01em;
}


/* ---------------------------------------------------------
 * Value editor
 * --------------------------------------------------------- */

.mpas-config-modal-panel
.mpas-config-editor-controls {
    grid-column: 3;
    grid-row: 1;

    gap: 0.35rem;
    margin-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-value {
    min-height: 34px;

    color: #212529;
    background: #ffffff;

    border-color: #d7dee7;
    border-radius: 0;

    font-size: 0.875rem !important;
    line-height: 1.5;

    box-shadow: none;
}

.mpas-config-modal-panel
.mpas-config-editor-value:focus {
    border-color: #86b7fe;

    box-shadow:
        0 0 0 0.16rem
        rgba(13, 110, 253, 0.12);
}

.mpas-config-modal-panel
.mpas-config-editor-note {
    grid-column: 3;
    grid-row: 2;

    margin-top: 0;

    color: #5c6770;

    font-size: 0.75rem;
    line-height: 1.35;
}


/* ---------------------------------------------------------
 * Documentation column
 * --------------------------------------------------------- */

.mpas-config-modal-panel
.mpas-config-editor-metadata {
    grid-column: 3;
    grid-row: 1 / span 2;

    min-width: 0;

    margin: 0;
    padding: 0.2rem 0;

    border-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-doc-description {
    color: #495057;

    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-line;
}

.mpas-config-modal-panel
.mpas-config-editor-doc-type {
    margin-top: 0.2rem;

    color: #5c6770;

    font-size: 0.75rem;
}

.mpas-config-modal-panel
.mpas-config-editor-meta-label {
    color: #6c757d;

    font-size: 0.67rem;
}

.mpas-config-modal-panel
.mpas-config-editor-meta-value {
    color: #495057;

    font-size: 0.75rem;
    line-height: 1.35;
}


/* ---------------------------------------------------------
 * Footer — same shell treatment as WRF
 * --------------------------------------------------------- */

.mpas-config-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 50px;

    gap: 0.75rem;

    padding: 10px;

    background: #f8fafc;

    border-top: 1px solid #e5e9ef;
}

.mpas-config-modal-footer-left,
.mpas-config-modal-footer-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 0.45rem;
}

.mpas-config-modal-footer .btn {
    padding: 0.25rem 0.5rem;

    font-size: 0.875rem;
    line-height: 1.5;
}


/* ---------------------------------------------------------
 * WRF-style floating scroll controls
 * --------------------------------------------------------- */

.mpas-config-scroll-dock {
    right: calc(3vw + 1.15rem);
    bottom: 5.75rem;

    gap: 0.45rem;
}

.mpas-config-scroll-button {
    width: 2.15rem;
    height: 2.15rem;

    border-radius: 999px;

    background:
        rgba(108, 117, 125, 0.95);

    color: #ffffff;

    box-shadow:
        0 0.35rem 0.85rem
        rgba(0, 0, 0, 0.24);
}

.mpas-config-scroll-button:hover,
.mpas-config-scroll-button:focus {
    background:
        rgba(90, 98, 104, 0.98);

    box-shadow:
        0 0 0 0.18rem
            rgba(108, 117, 125, 0.28),
        0 0.35rem 0.85rem
            rgba(0, 0, 0, 0.24);
}


/* ---------------------------------------------------------
 * Responsive row behavior follows WRF breakpoints
 * --------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .mpas-config-modal-panel
    .mpas-config-toolbar {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-search] {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-jump-record] {
        grid-column: 1;
        grid-row: 2;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-jump-option] {
        grid-column: 2;
        grid-row: 2;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-status-filter] {
        grid-column: 1;
        grid-row: 3;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-working-filter] {
        grid-column: 2;
        grid-row: 3;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar-actions {
        grid-column: 1 / -1;
        grid-row: 4;
    }

}

@media (max-width: 1100px) {
    .mpas-config-modal-panel
    .mpas-config-editor-option {
        grid-template-columns:
            1.75rem
            minmax(13rem, 1fr);
    }

    .mpas-config-editor-toggle-cell {
        grid-column: 1;
        grid-row: 1;
    }



    .mpas-config-modal-panel
    .mpas-config-editor-controls {
        grid-column: 2;
        grid-row: 2;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-note {
        grid-column: 2;
        grid-row: 3;
    }

    .mpas-config-editor-documentation {
        grid-column: 2;
        grid-row: 4;
    }
}


@media (max-width: 900px) {
    .mpas-config-modal-panel {
        top: 1vh;
        left: 1vw;

        width: 98vw;
        height: 98vh;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-search],
    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-jump-record],
    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-jump-option],
    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-status-filter],
    .mpas-config-modal-panel
    .mpas-config-toolbar
    [data-config-working-filter],
    .mpas-config-modal-panel
    .mpas-config-toolbar-actions {
        grid-column: 1;
        grid-row: auto;
    }

    .mpas-config-modal-panel
    .mpas-config-toolbar-actions {
        flex-wrap: wrap;
    }

    .mpas-config-scroll-dock {
        right: 1.25rem;
        bottom: 5.5rem;
    }
}


/* ---------------------------------------------------------
 * M5h.1b source-text and option-identity presentation cleanup
 * --------------------------------------------------------- */

.mpas-config-modal-panel
.mpas-config-editor-option-header {
    display: block;
}

.mpas-config-modal-panel
.mpas-config-editor-option-name {
    display: block;
    max-width: 100%;

    overflow-wrap: normal;
    word-break: normal;
}

.mpas-config-modal-panel
.mpas-config-editor-badges {
    justify-content: flex-start;

    margin-top: 0.2rem;
    margin-left: 0;
}

/* === MPAS / WRF CONFIGURATION STRICT LAYOUT PARITY M5H.1B END === */

/* === M5H.1B WRF RECORD HEADER ALIGNMENT START === */

.mpas-config-modal-panel
.mpas-config-record-summary {
    justify-content: flex-start;
}

.mpas-config-modal-panel
.mpas-config-record-summary
.mpas-config-record-name {
    flex: 0 1 auto;
    margin-right: 0.5rem;
}

.mpas-config-modal-panel
.mpas-config-record-summary
.badge-light {
    flex: 0 0 auto;
    margin-left: 0;
}

/* === M5H.1B WRF RECORD HEADER ALIGNMENT END === */

/* === M5H.1B WRF MODAL HEADER PARITY START === */

/*
 * Match the validated WRF namelist.input editor header hierarchy:
 * larger regular-weight title, readable muted subtitle, light shell header,
 * and a compact close control. Presentation only.
 */
.mpas-config-modal-panel
.mpas-config-modal-header {
    align-items: flex-start;
    padding: 1.05rem 1.25rem 0.95rem;

    background: #f8fafc;
    border-bottom: 1px solid #e5e9ef;
}

.mpas-config-modal-panel
.mpas-config-modal-heading {
    min-width: 0;
    padding-right: 1rem;
}

.mpas-config-modal-panel
.mpas-config-modal-title {
    margin: 0;

    color: #212529;

    font-size: 1.55rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
}

.mpas-config-modal-panel
.mpas-config-modal-subtitle {
    margin-top: 0.45rem;

    color: #5c6770;

    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
}

.mpas-config-modal-panel
.mpas-config-modal-close {
    flex: 0 0 auto;

    margin-top: 0.1rem;
    padding: 0.1rem 0.25rem;

    color: #6c757d;

    font-size: 1.55rem;
    font-weight: 300;
    line-height: 1;
}

.mpas-config-modal-panel
.mpas-config-modal-close:hover,
.mpas-config-modal-panel
.mpas-config-modal-close:focus {
    color: #343a40;
}

/* === M5H.1B WRF MODAL HEADER PARITY END === */

/* === M5H.2 REVIEW CHANGES START === */

/*
 * Read-only working-state review driven by M5c listChanges(core).
 * This layer presents baseline -> working differences only.
 */
.mpas-config-change-review {
    position: absolute;
    z-index: 15;

    top: 4.45rem;
    right: 0.75rem;
    bottom: 3.55rem;
    left: 0.75rem;

    display: flex;
    flex-direction: column;

    min-height: 0;
    overflow: hidden;

    color: #212529;
    background: #ffffff;

    border: 1px solid #e5e9ef;
    border-radius: 12px;

    box-shadow:
        0 0.5rem 1.4rem
        rgba(0, 0, 0, 0.16);
}

.mpas-config-change-review[hidden] {
    display: none !important;
}

.mpas-config-change-review-header {
    display: flex;
    flex: 0 0 auto;

    align-items: center;
    justify-content: space-between;

    gap: 0.75rem;
    padding: 0.7rem 0.85rem;

    background: #f8fafc;

    border-bottom: 1px solid #e5e9ef;
}

.mpas-config-change-review-title {
    min-width: 0;
    margin: 0;

    color: #212529;

    font-size: 1rem;
    font-weight: 600;
}

.mpas-config-change-review-close {
    flex: 0 0 auto;

    border: 0;
    background: transparent;

    color: #6c757d;

    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
}

.mpas-config-change-review-close:hover,
.mpas-config-change-review-close:focus {
    color: #343a40;
    outline: none;
}

.mpas-config-change-review-body {
    flex: 1 1 auto;

    min-height: 0;
    overflow: auto;

    padding: 0.85rem;
}

.mpas-config-change-review-summary {
    margin-bottom: 0.75rem;

    color: #5c6770;

    font-size: 0.82rem;
    line-height: 1.4;
}

.mpas-config-change-review-empty {
    margin: 0;
}

.mpas-config-change-review-table {
    width: 100%;

    border-collapse: collapse;

    color: #495057;

    font-size: 0.78rem;
}

.mpas-config-change-review-table th,
.mpas-config-change-review-table td {
    padding: 0.42rem 0.5rem;

    border-bottom: 1px solid #e9edf2;

    text-align: left;
    vertical-align: top;
}

.mpas-config-change-review-table th {
    position: sticky;
    top: 0;

    z-index: 1;

    color: #495057;
    background: #f7f9fb;

    font-weight: 700;
}

.mpas-config-change-review-option {
    color: #1f2933;
    background: transparent;

    font-size: 0.78rem;
    font-weight: 600;
}

.mpas-config-change-review-kind {
    white-space: nowrap;
}

.mpas-config-change-review-value {
    max-width: 24rem;

    overflow-wrap: anywhere;

    color: #343a40;

    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;

    white-space: pre-wrap;
}

.mpas-config-change-review-footer {
    display: flex;
    flex: 0 0 auto;

    align-items: center;
    justify-content: space-between;

    gap: 0.75rem;
    padding: 0.6rem 0.85rem;

    background: #f8fafc;

    border-top: 1px solid #e5e9ef;
}

.mpas-config-change-review-note {
    color: #5c6770;

    font-size: 0.72rem;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .mpas-config-change-review {
        top: 4.2rem;
        right: 0.4rem;
        bottom: 4rem;
        left: 0.4rem;
    }

    .mpas-config-change-review-table {
        min-width: 52rem;
    }

    .mpas-config-change-review-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* === M5H.2 REVIEW CHANGES END === */

/* === M5H.3 PROVENANCE / ACCESSIBILITY POLISH START === */

/*
 * Preserve the WRF-derived visual language while making keyboard focus
 * explicit on non-form controls. Text/select inputs retain their existing
 * Bootstrap-blue focus box-shadow rules.
 */
.mpas-config-modal-panel button:focus-visible,
.mpas-config-modal-panel a:focus-visible,
.mpas-config-modal-panel summary:focus-visible,
.mpas-config-preview-close:focus-visible,
.mpas-config-import-review-close:focus-visible,
.mpas-config-change-review-close:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.mpas-config-editor-provenance > summary {
    border-radius: 0.2rem;
}

.mpas-config-editor-provenance a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.78em;
}

/* === M5H.3 PROVENANCE / ACCESSIBILITY POLISH END === */



/* === M7.3 NAMEList EDITOR VISUAL CONVERSION START === */

/*
 * M7.3 keeps MPAS source authority intact but makes the normal Editor
 * workflow read like the WRF namelist editor:
 *
 *   include | option | value | description
 *
 * Registry/default/provenance evidence remains available through the
 * per-option Details disclosure and will move primarily to the dedicated
 * Documentation workspace in M7.5.
 */

.mpas-config-modal-panel
.mpas-config-editor-option {
    grid-template-columns:
        1.5rem
        minmax(13rem, 16rem)
        minmax(15rem, 20rem)
        minmax(20rem, 1fr);

    grid-template-rows:
        auto auto;

    column-gap: 0.65rem;
    row-gap: 0.15rem;

    align-items: center;

    padding: 6px 10px;
}

.mpas-config-modal-panel
.mpas-config-editor-toggle-cell {
    align-self: center;

    padding-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-option-header {
    grid-column: 2;
    grid-row: 1;

    display: flex;
    align-items: center;
    flex-wrap: wrap;

    min-height: 34px;

    gap: 0.2rem 0.4rem;
    padding: 0.25rem 0.5rem;
}

.mpas-config-modal-panel
.mpas-config-editor-option-name {
    flex: 1 1 auto;

    min-width: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-badges {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    flex-wrap: wrap;

    gap: 0.2rem;

    margin: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-badges
.badge {
    font-size: 0.62rem;
    font-weight: 600;
}

.mpas-config-modal-panel
.mpas-config-editor-controls {
    grid-column: 3;
    grid-row: 1;

    display: flex;
    align-items: center;

    min-width: 0;

    gap: 0.35rem;
}

.mpas-config-modal-panel
.mpas-config-editor-controls
.mpas-config-editor-value {
    flex: 1 1 auto;

    min-width: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-controls
.btn {
    flex: 0 0 auto;

    white-space: nowrap;
}

.mpas-config-modal-panel
.mpas-config-editor-note {
    grid-column: 3;
    grid-row: 2;

    display: none;

    margin-top: 0.05rem;
}

/*
 * Routine "Included in the working namelist" text adds little information.
 * Show the note only where user attention is actually required.
 */
.mpas-config-modal-panel
.mpas-config-editor-option.is-omitted
.mpas-config-editor-note,
.mpas-config-modal-panel
.mpas-config-editor-option.is-pending
.mpas-config-editor-note {
    display: block;
}

.mpas-config-modal-panel
.mpas-config-editor-documentation {
    grid-column: 4;
    grid-row: 1 / span 2;

    align-self: center;

    padding-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-documentation
.mpas-config-editor-metadata {
    display: block;

    margin: 0;
    padding: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-doc-description {
    margin: 0;

    font-size: 0.8rem;
    line-height: 1.35;
}

.mpas-config-modal-panel
.mpas-config-editor-doc-type {
    display: inline-block;

    margin-top: 0.15rem;

    font-size: 0.7rem;
}

.mpas-config-modal-panel
.mpas-config-editor-choice-list {
    margin-top: 0.25rem;
}

.mpas-config-modal-panel
.mpas-config-editor-choice-label {
    margin-bottom: 0.15rem;

    color: #6c757d;

    font-size: 0.67rem;
    font-weight: 600;
}

.mpas-config-modal-panel
.mpas-config-editor-choice-values {
    display: flex;
    flex-wrap: wrap;

    gap: 0.2rem;
}

.mpas-config-modal-panel
.mpas-config-editor-choice {
    padding: 0.1rem 0.35rem;

    border: 1px solid #ced4da;
    border-radius: 0.2rem;

    color: #495057;
    background: #ffffff;

    font-size: 0.68rem;
    line-height: 1.3;
}

.mpas-config-modal-panel
.mpas-config-editor-choice:hover,
.mpas-config-modal-panel
.mpas-config-editor-choice:focus {
    color: #0d6efd;
    background: #f8fbff;

    border-color: #86b7fe;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details {
    margin-top: 0.25rem;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-summary {
    display: inline-flex;
    align-items: center;

    gap: 0.25rem;

    border-radius: 0.2rem;

    color: #0d6efd;

    cursor: pointer;

    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.3;

    list-style: none;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-summary::-webkit-details-marker {
    display: none;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-summary::before {
    content: '▸';

    color: #6c757d;

    font-size: 0.72rem;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details[open]
> .mpas-config-editor-source-details-summary::before {
    content: '▾';
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-summary:hover {
    text-decoration: underline;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-body {
    margin-top: 0.4rem;
    padding: 0.5rem 0.6rem;

    color: #495057;
    background: #f8fafc;

    border: 1px solid #e5e9ef;
    border-radius: 6px;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-body
.mpas-config-editor-metadata-grid {
    margin-top: 0;
}

.mpas-config-modal-panel
.mpas-config-editor-source-details-body
.mpas-config-editor-provenance {
    margin-top: 0.45rem;
}

/*
 * Preserve the existing responsive editor behavior after the M7.3 desktop
 * overrides above.
 */
/*
 * Medium-width editor: preserve the WRF-style option/value relationship
 * instead of vertically stacking every field. Documentation spans beneath
 * the editable row.
 */
@media (max-width: 1100px) {
    .mpas-config-modal-panel
    .mpas-config-editor-option {
        grid-template-columns:
            1.5rem
            minmax(12rem, 0.9fr)
            minmax(14rem, 1.25fr);

        grid-template-rows:
            auto auto auto;

        align-items: center;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-toggle-cell {
        grid-column: 1;
        grid-row: 1;

        align-self: center;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-option-header {
        grid-column: 2;
        grid-row: 1;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-controls {
        grid-column: 3;
        grid-row: 1;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-note {
        grid-column: 2 / 4;
        grid-row: 2;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-documentation {
        grid-column: 2 / 4;
        grid-row: 3;

        padding-top: 0.15rem;
    }
}

/*
 * Narrow screens finally collapse to the single editing column.
 */
@media (max-width: 760px) {
    .mpas-config-modal-panel
    .mpas-config-editor-option {
        grid-template-columns:
            1.5rem
            minmax(0, 1fr);

        align-items: start;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-toggle-cell {
        grid-column: 1;
        grid-row: 1;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-option-header {
        grid-column: 2;
        grid-row: 1;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-controls {
        grid-column: 2;
        grid-row: 2;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-note {
        grid-column: 2;
        grid-row: 3;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-documentation {
        grid-column: 2;
        grid-row: 4;
    }
}

@media (max-width: 700px) {
    .mpas-config-modal-panel
    .mpas-config-editor-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .mpas-config-modal-panel
    .mpas-config-editor-controls
    .btn {
        align-self: flex-start;
    }
}

/* === M7.3 NAMEList EDITOR VISUAL CONVERSION END === */

/* === MPAS STREAMS BROWSER M6.2 START === */

.mpas-streams-toolbar [data-streams-search] {
    grid-column: 1 / -1;
}

.mpas-stream-card {
    margin-bottom: 0.45rem;
}

.mpas-stream-member-group {
    margin-top: 0.55rem;
    border: 1px solid #e1e7eb;
    border-radius: 3px;
    background: #fff;
}

.mpas-stream-member-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.42rem 0.48rem;
    cursor: pointer;
    color: #343a40;
    font-size: 0.76rem;
    font-weight: 600;
    background: #f8fbfd;
}

.mpas-stream-member-group-summary:hover {
    background: #eef6fb;
}

.mpas-stream-member-list {
    border-top: 1px solid #e6ebef;
}

.mpas-stream-member {
    padding: 0.36rem 0.48rem;
    border-bottom: 1px solid #edf0f2;
}

.mpas-stream-member:last-child {
    border-bottom: 0;
}

.mpas-stream-member-main {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
}

.mpas-stream-member-name,
.mpas-stream-list-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.74rem;
}

.mpas-stream-member-meta,
.mpas-stream-artifact {
    margin-top: 0.18rem;
    overflow-wrap: anywhere;
    color: #6c757d;
    font-size: 0.67rem;
    line-height: 1.35;
}

.mpas-stream-member-meta a {
    overflow-wrap: anywhere;
}

.mpas-stream-artifact {
    padding: 0.36rem 0.48rem;
    border-bottom: 1px solid #edf0f2;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.mpas-stream-list-heading {
    margin-top: 0.65rem;
    color: #495057;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

@media (max-width: 575.98px) {
    .mpas-streams-toolbar [data-streams-search] {
        grid-column: auto;
    }

    .mpas-stream-member-group-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* === MPAS STREAMS BROWSER M6.2 END === */


/* === MPAS STREAMS MODAL M6.2B START === */

.mpas-streams-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1980;
    background: rgba(0, 0, 0, 0.48);
}

.mpas-streams-modal-backdrop[hidden] {
    display: none !important;
}

.mpas-streams-modal-panel {
    color: #212529;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-streams-toolbar {
    grid-template-columns:
        minmax(16rem, 1.4fr)
        minmax(13rem, 0.72fr)
        minmax(13rem, 0.72fr)
        auto;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-streams-toolbar
[data-streams-search] {
    grid-column: auto;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-results {
    padding-right: 1rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-card {
    overflow: hidden;
    margin-bottom: 0.7rem;
    border: 1px solid #e9edf2;
    border-radius: 10px;
    background: #ffffff;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-option-summary {
    padding: 0.58rem 0.7rem;
    background: #f7f9fb;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-option-body {
    padding: 0.75rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-field-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.9rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-wide-field,
.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-source-field {
    grid-column: span 2;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-member-group {
    border-color: #e9edf2;
    border-radius: 8px;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-member-group-summary {
    background: #f7f9fb;
}

.mpas-streams-readonly-note {
    color: #5c6770;
    font-size: 0.72rem;
    line-height: 1.25;
}

@media (max-width: 1199.98px) {
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-streams-toolbar {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(12rem, 0.65fr);
    }



    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-config-field-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-config-wide-field,
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-config-source-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-streams-toolbar,
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-config-field-grid {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-streams-toolbar
    [data-streams-search],
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-config-wide-field,
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-config-source-field {
        grid-column: auto;
    }
}

/* === MPAS STREAMS MODAL M6.2B END === */


/* === MPAS STREAMS METADATA CLEANUP M6.2C START === */

.mpas-stream-overview {
    display: grid;
    grid-template-columns:
        minmax(15rem, 0.9fr)
        minmax(20rem, 1.15fr)
        minmax(20rem, 1.15fr);
    gap: 0.7rem;
}

.mpas-stream-overview-group {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border: 1px solid #e7ebef;
    border-radius: 8px;
    background: #fbfcfd;
}

.mpas-stream-overview-title {
    margin: 0 0 0.55rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #edf0f3;
    color: #495057;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.mpas-stream-overview-fields {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.48rem 0.8rem;
}

.mpas-stream-overview-fields
.mpas-config-wide-field,
.mpas-stream-overview-fields
.mpas-config-source-field {
    grid-column: 1 / -1;
}

.mpas-stream-overview-fields
.mpas-config-field-label {
    font-size: 0.62rem;
}

.mpas-stream-overview-fields
.mpas-config-field-value {
    font-size: 0.7rem;
}

.mpas-stream-advanced {
    margin-top: 0.65rem;
    border: 1px solid #e7ebef;
    border-radius: 8px;
    background: #ffffff;
}

.mpas-stream-advanced-summary {
    padding: 0.48rem 0.62rem;
    cursor: pointer;
    color: #5c6770;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f8fafc;
}

.mpas-stream-advanced-summary:hover {
    background: #f3f6f9;
}

.mpas-stream-advanced-body {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0.65rem;
    border-top: 1px solid #e9edf2;
}

.mpas-stream-raw-block {
    min-width: 0;
}

.mpas-stream-raw-title {
    margin-bottom: 0.25rem;
    color: #6c757d;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mpas-stream-raw-json {
    max-height: 14rem;
    margin: 0;
    padding: 0.55rem 0.6rem;
    overflow: auto;
    border: 1px solid #e3e8ec;
    border-radius: 5px;
    background: #f8fafc;
    color: #343a40;
    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;
    font-size: 0.67rem;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-option-body {
    padding: 0.68rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-member-group {
    margin-top: 0.65rem;
}

@media (max-width: 1199.98px) {
    .mpas-stream-overview {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mpas-stream-overview-provenance {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .mpas-stream-overview,
    .mpas-stream-advanced-body {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-stream-overview-provenance {
        grid-column: auto;
    }
}

/* === MPAS STREAMS METADATA CLEANUP M6.2C END === */


/* === MPAS STREAMS DECLARATION EDITOR M6.4 START === */

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-card.is-dirty {
    border-color: #efd46c;
    box-shadow: inset 4px 0 0 #f0c419;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-card.is-working-omitted {
    background: #fbfcfd;
}

.mpas-stream-summary-state {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
}

.mpas-stream-editor-controls {
    display: grid;
    grid-template-columns: minmax(14rem, auto) minmax(12rem, 1fr) auto;
    align-items: center;
    gap: 0.55rem 0.8rem;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    background: #f8fafc;
}

.mpas-stream-editor-include {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: #343a40;
    font-size: 0.78rem;
    font-weight: 600;
}

.mpas-stream-editor-include-input {
    margin: 0;
    accent-color: #0d6efd;
}

.mpas-stream-editor-state-note {
    min-width: 0;
    color: #6c757d;
    font-size: 0.7rem;
    line-height: 1.3;
}

.mpas-stream-editor-reset {
    white-space: nowrap;
}

.mpas-stream-editor-error {
    grid-column: 1 / -1;
    padding: 0.4rem 0.5rem;
    border: 1px solid #f1b8bd;
    border-radius: 5px;
    background: #fff5f5;
    color: #842029;
    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-stream-editor-error[hidden] {
    display: none !important;
}

.mpas-stream-overview-editable {
    background: #f8fbff;
    border-color: #dce9f7;
}

.mpas-stream-editor-field {
    display: block;
    margin: 0;
}

.mpas-stream-editor-input {
    min-height: 32px;
    margin-top: 0.18rem;
    border-color: #d7dee7;
    border-radius: 4px;
    background: #ffffff;
    color: #212529;
    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-stream-editor-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.14rem rgba(13, 110, 253, 0.12);
}

.mpas-stream-editor-input:disabled {
    background: #eef1f4;
    color: #6c757d;
}

.mpas-stream-editor-field-note {
    margin-top: 0.18rem;
    color: #6c757d;
    font-size: 0.61rem;
    line-height: 1.3;
}

.mpas-streams-editor-note {
    color: #5c6770;
    font-size: 0.72rem;
    line-height: 1.25;
}

@media (max-width: 900px) {
    .mpas-stream-editor-controls {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .mpas-stream-editor-state-note {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 575.98px) {
    .mpas-stream-editor-controls {
        grid-template-columns: minmax(0, 1fr);
    }
    .mpas-stream-editor-state-note,
    .mpas-stream-editor-reset {
        grid-column: auto;
        grid-row: auto;
    }
    .mpas-stream-summary-state {
        justify-content: flex-start;
    }
}

/* === MPAS STREAMS DECLARATION EDITOR M6.4 END === */


/* === MPAS STREAMS MEMBER EDITOR M6.5B START === */

.mpas-stream-list-editor {
    border-color: #d9e4ef !important;
    background: #ffffff;
}

.mpas-stream-list-editor
.mpas-stream-member-group-summary {
    gap: 0.45rem;
}

.mpas-stream-list-editor-body {
    border-top: 1px solid #edf0f2;
}

.mpas-stream-list-editor-note {
    padding: 0.42rem 0.5rem;
    border-bottom: 1px solid #edf0f2;
    background: #f8fafc;
    color: #5c6770;
    font-size: 0.68rem;
    line-height: 1.35;
}

.mpas-stream-list-editor-controls {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1fr)
        auto
        auto;
    gap: 0.4rem;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #edf0f2;
    background: #fbfcfd;
}

.mpas-stream-list-editor-members {
    max-height: 24rem;
    overflow: auto;
    overscroll-behavior: contain;
}

.mpas-stream-list-editor-member {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.38rem 0.5rem;
    border-bottom: 1px solid #f0f2f4;
}

.mpas-stream-list-editor-member:last-child {
    border-bottom: 0;
}

.mpas-stream-list-editor-member-identity {
    min-width: 0;
}

.mpas-stream-list-editor-member-identity
.badge {
    margin-left: 0.35rem;
}

.mpas-stream-list-editor-member-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.mpas-stream-list-editor-member-actions
.btn {
    min-width: 2rem;
    padding: 0.18rem 0.38rem;
    font-size: 0.68rem;
    line-height: 1.25;
}

@media (max-width: 767.98px) {
    .mpas-stream-list-editor-controls {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
    }

    .mpas-stream-list-editor-controls
    select {
        grid-column: 1 / -1;
    }

    .mpas-stream-list-editor-member {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-stream-list-editor-member-actions {
        justify-content: flex-start;
    }
}

/* === MPAS STREAMS MEMBER EDITOR M6.5B END === */



/* === M7.4 STREAMS EDITOR VISUAL CONVERSION START === */

/*
 * WRF-style Streams editing hierarchy:
 *
 *   stream identity / state
 *   working include/reset controls
 *   declaration + editable file/I/O fields
 *   working external stream lists
 *   collapsed source/provenance evidence
 *
 * Presentation only. M6 source authority, working-state, member editing,
 * serialization, and import semantics remain unchanged.
 */

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-card {
    margin-bottom: 0.8rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-card
> .mpas-config-option-summary {
    min-height: 42px;
    padding: 0.55rem 0.75rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-summary-state {
    gap: 0.2rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-summary-state
.badge {
    font-size: 0.63rem;
    font-weight: 600;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-config-option-body {
    padding: 0.65rem 0.7rem 0.75rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-editor-controls {
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-overview-editor {
    grid-template-columns:
        minmax(16rem, 0.8fr)
        minmax(28rem, 1.6fr);

    gap: 0.55rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-overview-editor
.mpas-stream-overview-group {
    padding: 0.55rem 0.6rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-overview-editor
.mpas-stream-overview-title {
    margin-bottom: 0.45rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-overview-editor
.mpas-stream-overview-fields {
    gap: 0.4rem 0.65rem;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-list-heading {
    margin-top: 0.7rem;
    margin-bottom: 0.3rem;

    color: #495057;

    font-size: 0.7rem;
    font-weight: 700;

    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-stream-list-editor {
    margin-top: 0.3rem;
}

.mpas-stream-source-details {
    margin-top: 0.7rem;
    overflow: hidden;

    border: 1px solid #e5e9ef;
    border-radius: 8px;

    background: #ffffff;
}

.mpas-stream-source-details-summary {
    display: flex;
    align-items: center;

    min-height: 36px;

    gap: 0.4rem;
    padding: 0.45rem 0.6rem;

    list-style: none;

    color: #5c6770;
    background: #f8fafc;

    cursor: pointer;

    font-size: 0.72rem;
    font-weight: 600;
}

.mpas-stream-source-details-summary::-webkit-details-marker {
    display: none;
}

.mpas-stream-source-details-summary::before {
    content: '▸';

    flex: 0 0 auto;

    color: #6c757d;

    font-size: 0.76rem;
}

.mpas-stream-source-details[open]
> .mpas-stream-source-details-summary::before {
    content: '▾';
}

.mpas-stream-source-details-summary:hover {
    color: #343a40;
    background: #f3f6f9;
}

.mpas-stream-source-details-body {
    padding: 0.6rem;
    border-top: 1px solid #e9edf2;
}

.mpas-stream-source-details-body
> .mpas-stream-overview-provenance {
    margin: 0;
    background: #fbfcfd;
}

.mpas-stream-source-details-body
> .mpas-stream-advanced,
.mpas-stream-source-details-body
> .mpas-stream-member-group {
    margin-top: 0.55rem;
}

@media (max-width: 1199.98px) {
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-stream-overview-editor {
        grid-template-columns:
            minmax(14rem, 0.85fr)
            minmax(20rem, 1.3fr);
    }
}

@media (max-width: 850px) {
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-stream-overview-editor {
        grid-template-columns:
            minmax(0, 1fr);
    }
}

/* M7.4b Streams core switch */

.mpas-streams-core-switch {
    display: inline-grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.2rem;

    min-width: 0;

    padding: 0.18rem;

    border: 1px solid #d7dee7;
    border-radius: 6px;

    background: #f8fafc;
}

.mpas-streams-core-switch
[data-streams-core-option] {
    min-width: 0;

    padding: 0.33rem 0.6rem;

    border-radius: 4px;

    white-space: nowrap;

    font-size: 0.72rem;
    font-weight: 600;

    line-height: 1.25;
}

.mpas-streams-core-switch
[data-streams-core-option][aria-pressed="true"] {
    border-color: #0d6efd;

    background: #0d6efd;
    color: #ffffff;
}

.mpas-streams-core-switch
[data-streams-core-option][aria-pressed="false"] {
    background: #ffffff;
    color: #0d6efd;
}

.mpas-streams-core-switch
[data-streams-core-option]:focus-visible {
    outline: 2px solid #86b7fe;
    outline-offset: 2px;
}

.mpas-config-modal-panel.mpas-streams-modal-panel
.mpas-streams-toolbar {
    grid-template-columns:
        minmax(16rem, 1.4fr)
        minmax(20rem, 1fr)
        minmax(13rem, 0.72fr)
        auto;
}

@media (max-width: 1199.98px) {
    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-streams-toolbar {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
    }

    .mpas-config-modal-panel.mpas-streams-modal-panel
    .mpas-streams-toolbar
    [data-streams-search] {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .mpas-streams-core-switch {
        grid-template-columns:
            minmax(0, 1fr);
    }
}

/* === M7.4 STREAMS EDITOR VISUAL CONVERSION END === */

/* === MPAS CONFIGURATION MODAL TABS M7.2 START === */

/*
 * Shared Editor / Text / Documentation shell modeled on the WRF
 * Configuration Studio namelist dialog.
 *
 * Presentation only. Configuration semantics remain owned by the
 * pre-existing MPAS model, working-state, serializer, and importer APIs.
 */

.mpas-config-modal-tabs {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 0;

    padding: 0 10px;

    background: #f8fafc;

    border-bottom: 1px solid #dee2e6;
}

.mpas-config-modal-tab {
    position: relative;

    margin: 0 0 -1px;
    padding: 0.55rem 0.9rem;

    color: #495057;
    background: transparent;

    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;

    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.35;

    cursor: pointer;
}

.mpas-config-modal-tab:hover {
    color: #212529;
    border-color:
        #e9ecef
        #e9ecef
        #dee2e6;
}

.mpas-config-modal-tab[aria-selected="true"] {
    color: #0d6efd;
    background: #ffffff;

    border-color:
        #dee2e6
        #dee2e6
        #ffffff;
}

.mpas-config-modal-tab:focus-visible {
    z-index: 1;

    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

.mpas-config-modal-tab-content {
    display: flex;
    flex: 1 1 auto;

    min-height: 0;

    overflow: hidden;

    background: #ffffff;
}

.mpas-config-modal-tab-pane {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    background: #ffffff;
}

.mpas-config-modal-tab-pane[hidden] {
    display: none !important;
}

.mpas-config-modal-tab-pane[data-config-modal-pane="editor"] {
    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.mpas-config-modal-tab-pane[data-config-modal-pane="text"],
.mpas-config-modal-tab-pane[data-config-modal-pane="documentation"] {
    overflow: auto;

    padding: 1rem;
}

.mpas-config-modal-tab-placeholder {
    max-width: 58rem;

    padding: 1rem;

    border: 1px solid #e9edf2;
    border-radius: 10px;

    background: #f8fafc;
}

.mpas-config-modal-tab-placeholder-title {
    margin: 0 0 0.45rem;

    color: #212529;

    font-size: 1rem;
    font-weight: 600;
}

.mpas-config-modal-tab-placeholder-text {
    margin: 0;

    color: #5c6770;

    font-size: 0.875rem;
    line-height: 1.5;
}

/*
 * The existing toolbar / summary / results elements now live inside
 * the Editor tab pane. Their selectors and behavior remain unchanged.
 */

.mpas-config-modal-tab-pane[data-config-modal-pane="editor"]
.mpas-config-results {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 575.98px) {
    .mpas-config-modal-tabs {
        overflow-x: auto;
        padding: 0 6px;
    }

    .mpas-config-modal-tab {
        flex: 0 0 auto;
        padding:
            0.5rem
            0.65rem;
    }
}

/* === MPAS CONFIGURATION MODAL TABS M7.2 END === */


/* === MPAS SERIALIZER TEXT WORKSPACE M7.2 START === */

.mpas-config-text-heading {
    margin: 0;

    color: #212529;

    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.mpas-config-text-note {
    margin-top: 0.25rem;

    color: #5c6770;

    font-size: 0.8rem;
    line-height: 1.4;
}

.mpas-config-text-toolbar {
    display: flex;
    align-items: end;
    gap: 0.6rem;

    margin-top: 0.75rem;
}

.mpas-config-text-label {
    display: flex;
    flex: 1 1 28rem;
    flex-direction: column;
    gap: 0.25rem;

    max-width: 42rem;

    margin: 0;

    color: #495057;

    font-size: 0.75rem;
    font-weight: 600;
}

.mpas-config-text-output {
    flex: 1 1 auto;

    min-height: 0;

    margin:
        0.75rem
        0
        0;

    padding: 0.8rem;

    overflow: auto;

    color: #212529;
    background: #fbfcfd;

    border: 1px solid #dee2e6;
    border-radius: 6px;

    font-family:
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;

    font-size: 0.78rem;
    line-height: 1.45;

    white-space: pre;
    tab-size: 4;
}

.mpas-config-modal-tab-pane[
    data-config-modal-pane="text"
] {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/*
 * The floating jump controls operate on Editor records only.
 */
.mpas-config-modal-panel:not(
    [data-config-modal-active-tab="editor"]
)
.mpas-config-scroll-dock {
    display: none;
}

/* === MPAS SERIALIZER TEXT WORKSPACE M7.2 END === */

/* === M7.5a NAMELIST DOCUMENTATION WORKSPACE START === */

.mpas-config-documentation-workspace {
    max-width: 100%;
}

.mpas-config-documentation-heading {
    margin: 0;

    color: #212529;

    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.mpas-config-documentation-note {
    margin-top: 0.25rem;

    color: #5c6770;

    font-size: 0.8rem;
    line-height: 1.45;
}

.mpas-config-documentation-toolbar {
    display: grid;

    grid-template-columns:
        minmax(18rem, 1fr)
        minmax(12rem, 0.45fr)
        auto;

    gap: 0.5rem;

    align-items: center;

    margin-top: 0.8rem;
}

.mpas-config-documentation-actions {
    display: inline-flex;

    gap: 0.35rem;

    justify-content: flex-end;
}

.mpas-config-documentation-summary {
    margin-top: 0.55rem;

    padding: 0.45rem 0.6rem;

    border: 1px solid #e7ebef;
    border-radius: 6px;

    background: #f8fafc;
    color: #5c6770;

    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-config-documentation-results {
    margin-top: 0.6rem;
}

.mpas-config-documentation-record {
    margin-bottom: 0.6rem;

    overflow: hidden;

    border: 1px solid #dfe5eb;
    border-radius: 8px;

    background: #ffffff;
}

.mpas-config-documentation-record-summary {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 0.5rem;

    padding: 0.55rem 0.65rem;

    cursor: pointer;

    background: #f7f9fb;
    color: #343a40;

    font-size: 0.78rem;
    font-weight: 600;
}

.mpas-config-documentation-record-summary:hover {
    background: #f1f5f8;
}

.mpas-config-documentation-option-list {
    padding: 0.5rem;

    border-top: 1px solid #e9edf2;

    background: #fbfcfd;
}

.mpas-config-documentation-option {
    margin-bottom: 0.4rem;

    overflow: hidden;

    border: 1px solid #e4e9ee;
    border-radius: 6px;

    background: #ffffff;
}

.mpas-config-documentation-option:last-child {
    margin-bottom: 0;
}

.mpas-config-documentation-option-summary {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 0.5rem;

    min-height: 38px;

    padding: 0.45rem 0.55rem;

    cursor: pointer;

    background: #ffffff;

    font-size: 0.74rem;
}

.mpas-config-documentation-option-summary:hover {
    background: #f8fafc;
}

.mpas-config-documentation-option-identity {
    display: inline-flex;

    min-width: 0;

    flex-wrap: wrap;

    align-items: center;

    gap: 0.35rem;
}

.mpas-config-documentation-option-name {
    overflow-wrap: anywhere;

    font-size: 0.76rem;
}

.mpas-config-documentation-option-body {
    padding: 0.6rem;

    border-top: 1px solid #edf0f3;

    background: #ffffff;
}

.mpas-config-documentation-description {
    margin-bottom: 0.6rem;

    padding: 0.5rem 0.55rem;

    border-left: 3px solid #d7e4f3;

    background: #f8fbff;

    color: #343a40;

    font-size: 0.76rem;
    line-height: 1.45;

    white-space: pre-line;
}

.mpas-config-documentation-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 0.5rem 0.75rem;
}

.mpas-config-documentation-field {
    min-width: 0;
}

.mpas-config-documentation-field.is-wide {
    grid-column: 1 / -1;
}

.mpas-config-documentation-field-label {
    margin-bottom: 0.12rem;

    color: #6c757d;

    font-size: 0.62rem;
    font-weight: 700;

    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.mpas-config-documentation-field-value {
    overflow-wrap: anywhere;

    color: #343a40;

    font-size: 0.72rem;
    line-height: 1.4;
}

.mpas-config-documentation-field-value a {
    overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
    .mpas-config-documentation-toolbar {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(12rem, 0.5fr);
    }

    .mpas-config-documentation-actions {
        grid-column: 1 / -1;

        justify-content: flex-start;
    }

    .mpas-config-documentation-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .mpas-config-documentation-toolbar,
    .mpas-config-documentation-grid {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-config-documentation-actions {
        grid-column: auto;

        flex-wrap: wrap;
    }

    .mpas-config-documentation-field.is-wide {
        grid-column: auto;
    }
}

/* === M7.5a NAMELIST DOCUMENTATION WORKSPACE END === */

/* === M7.5b STREAMS DOCUMENTATION WORKSPACE START === */

.mpas-stream-documentation-workspace {
    max-width: 100%;
}

.mpas-stream-documentation-heading {
    margin: 0;

    color: #212529;

    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.mpas-stream-documentation-note {
    margin-top: 0.25rem;

    color: #5c6770;

    font-size: 0.8rem;
    line-height: 1.45;
}

.mpas-stream-documentation-toolbar {
    display: grid;

    grid-template-columns:
        minmax(15rem, 1.2fr)
        minmax(19rem, 0.9fr)
        minmax(12rem, 0.65fr)
        auto;

    gap: 0.5rem;

    align-items: center;

    margin-top: 0.8rem;
}

.mpas-stream-documentation-core-switch {
    display: inline-grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.2rem;

    min-width: 0;

    padding: 0.18rem;

    border: 1px solid #d7dee7;
    border-radius: 6px;

    background: #f8fafc;
}

.mpas-stream-documentation-core-switch
[data-stream-documentation-core-option] {
    min-width: 0;

    padding: 0.33rem 0.6rem;

    border-radius: 4px;

    white-space: nowrap;

    font-size: 0.72rem;
    font-weight: 600;

    line-height: 1.25;
}

.mpas-stream-documentation-core-switch
[data-stream-documentation-core-option][aria-pressed="true"] {
    border-color: #0d6efd;

    background: #0d6efd;
    color: #ffffff;
}

.mpas-stream-documentation-core-switch
[data-stream-documentation-core-option][aria-pressed="false"] {
    background: #ffffff;
    color: #0d6efd;
}

.mpas-stream-documentation-actions {
    display: inline-flex;

    gap: 0.35rem;

    justify-content: flex-end;
}

.mpas-stream-documentation-summary {
    margin-top: 0.55rem;

    padding: 0.45rem 0.6rem;

    border: 1px solid #e7ebef;
    border-radius: 6px;

    background: #f8fafc;
    color: #5c6770;

    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-stream-documentation-results {
    margin-top: 0.6rem;
}

.mpas-stream-documentation-stream {
    margin-bottom: 0.6rem;

    overflow: hidden;

    border: 1px solid #dfe5eb;
    border-radius: 8px;

    background: #ffffff;
}

.mpas-stream-documentation-stream-summary {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 0.5rem;

    padding: 0.55rem 0.65rem;

    cursor: pointer;

    background: #f7f9fb;
}

.mpas-stream-documentation-stream-summary:hover {
    background: #f1f5f8;
}

.mpas-stream-documentation-stream-identity {
    display: inline-flex;

    min-width: 0;

    flex-wrap: wrap;

    align-items: center;

    gap: 0.35rem;
}

.mpas-stream-documentation-stream-name {
    overflow-wrap: anywhere;

    font-size: 0.78rem;
}

.mpas-stream-documentation-stream-body {
    padding: 0.6rem;

    border-top: 1px solid #e9edf2;
}

.mpas-stream-documentation-authority-note {
    margin-bottom: 0.6rem;

    padding: 0.5rem 0.55rem;

    border-left: 3px solid #d7e4f3;

    background: #f8fbff;

    color: #495057;

    font-size: 0.74rem;
    line-height: 1.45;
}

.mpas-stream-documentation-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 0.5rem 0.75rem;
}

.mpas-stream-documentation-field {
    min-width: 0;
}

.mpas-stream-documentation-field.is-wide {
    grid-column: 1 / -1;
}

.mpas-stream-documentation-field-label {
    margin-bottom: 0.12rem;

    color: #6c757d;

    font-size: 0.62rem;
    font-weight: 700;

    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.mpas-stream-documentation-field-value {
    overflow-wrap: anywhere;

    color: #343a40;

    font-size: 0.72rem;
    line-height: 1.4;
}

.mpas-stream-documentation-members,
.mpas-stream-documentation-references,
.mpas-stream-documentation-list {
    margin-top: 0.6rem;

    overflow: hidden;

    border: 1px solid #e4e9ee;
    border-radius: 6px;

    background: #ffffff;
}

.mpas-stream-documentation-members-summary,
.mpas-stream-documentation-references-summary,
.mpas-stream-documentation-list-summary {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 0.5rem;

    padding: 0.45rem 0.55rem;

    cursor: pointer;

    background: #f8fafc;

    color: #343a40;

    font-size: 0.72rem;
    font-weight: 600;
}

.mpas-stream-documentation-members-body,
.mpas-stream-documentation-references-body,
.mpas-stream-documentation-list-body {
    padding: 0.55rem;

    border-top: 1px solid #e9edf2;
}

.mpas-stream-documentation-subheading {
    margin-bottom: 0.35rem;

    color: #495057;

    font-size: 0.67rem;
    font-weight: 700;

    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.mpas-stream-documentation-reference-list {
    margin-bottom: 0.55rem;
}

.mpas-stream-documentation-reference-item {
    margin-bottom: 0.25rem;

    padding: 0.3rem 0.4rem;

    border: 1px solid #edf0f3;
    border-radius: 4px;

    background: #fbfcfd;

    font-size: 0.7rem;
}

.mpas-stream-documentation-table-wrap {
    width: 100%;

    overflow: auto;
}

.mpas-stream-documentation-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 0.68rem;
}

.mpas-stream-documentation-table th,
.mpas-stream-documentation-table td {
    padding: 0.35rem 0.4rem;

    border-bottom: 1px solid #edf0f3;

    vertical-align: top;

    text-align: left;

    overflow-wrap: anywhere;
}

.mpas-stream-documentation-table th {
    color: #59636e;

    background: #f8fafc;

    font-size: 0.62rem;
    font-weight: 700;

    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mpas-stream-documentation-table tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 1200px) {
    .mpas-stream-documentation-toolbar {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
    }

    .mpas-stream-documentation-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 800px) {
    .mpas-stream-documentation-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .mpas-stream-documentation-toolbar,
    .mpas-stream-documentation-grid,
    .mpas-stream-documentation-core-switch {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-stream-documentation-actions {
        flex-wrap: wrap;
    }

    .mpas-stream-documentation-field.is-wide {
        grid-column: auto;
    }
}

/* === M7.5b STREAMS DOCUMENTATION WORKSPACE END === */


/* === M7.6b MODAL STATUS / RESPONSIVE / ACCESSIBILITY POLISH START === */

/*
 * Editor / Text / Documentation footer actions follow the active workspace.
 *
 * Namelist:
 *   Editor        -> Open / Review Changes / Reset / Close
 *   Text          -> serializer status / Copy / Save / Close
 *   Documentation -> Close
 *
 * Streams:
 *   Editor        -> Import / editor status / Close
 *   Text          -> serializer status / Copy / Save / Save all / Close
 *   Documentation -> Close
 *
 * This is presentation only. Existing working-state, serializer,
 * importer, validation, and source-authority APIs remain authoritative.
 */

/* ---------------------------------------------------------
 * Namelist footer action scopes
 * --------------------------------------------------------- */

.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="editor"]
.mpas-config-modal-footer-right
.btn-primary,
.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="text"]
.mpas-config-modal-footer-left
> .btn,
.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="documentation"]
.mpas-config-modal-footer-left,
.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="documentation"]
.mpas-config-modal-footer-right
.btn:not(.btn-secondary) {
    display: none !important;
}


/* ---------------------------------------------------------
 * Streams footer action scopes
 * --------------------------------------------------------- */

.mpas-streams-modal-panel[data-config-modal-active-tab="editor"]
[data-streams-export-copy],
.mpas-streams-modal-panel[data-config-modal-active-tab="editor"]
[data-streams-export-save],
.mpas-streams-modal-panel[data-config-modal-active-tab="editor"]
[data-streams-export-save-all],
.mpas-streams-modal-panel[data-config-modal-active-tab="text"]
.mpas-streams-editor-note,
.mpas-streams-modal-panel[data-config-modal-active-tab="text"]
[data-streams-import-open],
.mpas-streams-modal-panel[data-config-modal-active-tab="documentation"]
.mpas-config-modal-footer-left,
.mpas-streams-modal-panel[data-config-modal-active-tab="documentation"]
[data-streams-export-copy],
.mpas-streams-modal-panel[data-config-modal-active-tab="documentation"]
[data-streams-export-save],
.mpas-streams-modal-panel[data-config-modal-active-tab="documentation"]
[data-streams-export-save-all] {
    display: none !important;
}


/* ---------------------------------------------------------
 * Shared status presentation
 * --------------------------------------------------------- */

.mpas-config-modal-footer
.mpas-config-export-status {
    max-width: 34rem;

    overflow-wrap: anywhere;

    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-config-modal-footer
.mpas-config-export-status:not(:empty) {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    padding: 0.3rem 0.5rem;

    color: #495057;
    background: #ffffff;

    border: 1px solid #d7dee7;
    border-radius: 5px;
}

.mpas-config-modal-footer
.mpas-config-export-status.is-error:not(:empty) {
    color: #842029;
    background: #fff5f5;
    border-color: #f1b8bd;
}


/* ---------------------------------------------------------
 * Narrow modal behavior
 * --------------------------------------------------------- */

@media (max-width: 767.98px) {
    .mpas-config-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .mpas-config-modal-footer-left,
    .mpas-config-modal-footer-right {
        flex: 0 0 auto;
        width: 100%;
    }

    .mpas-config-modal-footer-right {
        justify-content: flex-end;
    }

    .mpas-config-modal-footer
    .mpas-config-export-status {
        max-width: none;
        width: 100%;
    }

    .mpas-config-text-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .mpas-config-text-label {
        flex: 0 1 auto;

        width: 100%;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .mpas-config-modal-footer-right {
        justify-content: stretch;
    }

    .mpas-config-modal-footer-right
    .btn {
        flex: 1 1 auto;
    }
}

/* === M7.6b MODAL STATUS / RESPONSIVE / ACCESSIBILITY POLISH END === */


/* === M8.5d INTEGRATED VALIDATION UI POLISH START === */

/*
 * Presentation only.
 *
 * Integrated validation semantics remain owned by MPASIntegratedValidator.
 * These rules style the M8.5 Validation workspace and scope footer actions
 * without changing working state, validation, serialization, or import.
 */

.mpas-config-modal-tab-pane[data-config-modal-pane="validation"] {
    overflow: auto;

    padding: 1rem;
}

.mpas-validation-workspace {
    display: flex;
    flex-direction: column;

    min-width: 0;

    gap: 0.75rem;
}

.mpas-validation-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 0.75rem;
}

.mpas-validation-status {
    min-height: 1.25rem;

    color: #5c6770;

    font-size: 0.72rem;
    line-height: 1.35;
}

.mpas-validation-status.is-error {
    color: #842029;
}

.mpas-validation-summary {
    margin: 0;

    border-color: #d7dee7;

    background: #f8fafc;
}

.mpas-validation-scopes {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.6rem;
}

.mpas-validation-scopes
.mpas-config-field {
    min-width: 0;

    margin: 0;
    padding: 0.65rem 0.75rem;

    border: 1px solid #e5e9ef;
    border-radius: 6px;

    background: #ffffff;
}

.mpas-validation-scopes
[data-validation-evaluated="false"] {
    background: #f8fafc;
}

.mpas-validation-findings {
    min-width: 0;
}

.mpas-validation-result {
    margin: 0 0 0.65rem;
    padding: 0.75rem;

    border-color: #e1e6eb;

    background: #ffffff;
}

.mpas-validation-result:last-child {
    margin-bottom: 0;
}

.mpas-validation-result-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 0.4rem;

    margin-bottom: 0.45rem;
}

.mpas-validation-result-code {
    overflow-wrap: anywhere;

    color: #343a40;

    font-size: 0.73rem;
}

.mpas-validation-result-message {
    margin-bottom: 0.35rem;

    color: #343a40;

    font-size: 0.82rem;
    line-height: 1.4;
}

.mpas-validation-result-metadata {
    margin-top: 0.55rem;
}

.mpas-validation-result-metadata-value {
    max-height: 12rem;

    margin: 0.2rem 0 0;
    padding: 0.5rem 0.6rem;

    overflow: auto;

    border: 1px solid #e5e9ef;
    border-radius: 5px;

    background: #f8fafc;

    color: #495057;

    font-size: 0.68rem;
    line-height: 1.35;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mpas-validation-result-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 0.65rem;
}

/*
 * Validation is a read-only workspace.
 * Footer actions therefore collapse to Close, matching Documentation.
 */

.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="validation"]
.mpas-config-modal-footer-left,
.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="validation"]
.mpas-config-modal-footer-right
.btn:not(.btn-secondary),
.mpas-streams-modal-panel[data-config-modal-active-tab="validation"]
.mpas-config-modal-footer-left,
.mpas-streams-modal-panel[data-config-modal-active-tab="validation"]
[data-streams-export-copy],
.mpas-streams-modal-panel[data-config-modal-active-tab="validation"]
[data-streams-export-save],
.mpas-streams-modal-panel[data-config-modal-active-tab="validation"]
[data-streams-export-save-all],
.mpas-streams-modal-panel[data-config-modal-active-tab="validation"]
[data-streams-import-open] {
    display: none !important;
}

@media (max-width: 767.98px) {
    .mpas-validation-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .mpas-validation-toolbar
    .btn {
        align-self: flex-start;
    }

    .mpas-validation-scopes {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .mpas-validation-result-actions {
        justify-content: stretch;
    }

    .mpas-validation-result-actions
    .btn {
        width: 100%;
    }
}

/* === M8.5d INTEGRATED VALIDATION UI POLISH END === */

/* === M8.6c VALIDATION REPORT ACTIONS START === */

.mpas-validation-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 0.4rem;
}

.mpas-validation-toolbar-actions
.btn {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .mpas-validation-toolbar-actions {
        align-items: stretch;
        flex-direction: column;

        width: 100%;
    }

    .mpas-validation-toolbar-actions
    .btn {
        align-self: stretch;

        width: 100%;
    }
}

/* === M8.6c VALIDATION REPORT ACTIONS END === */

/* === MPAS PROJECT / REPRODUCIBILITY UI START === */

.mpas-project-panel {
    position: relative;
    min-height: 100%;
}

.mpas-project-intro {
    margin-bottom: 0.8rem;
    padding: 0.75rem;
    border: 1px solid #b8daff;
    border-radius: 0.35rem;
    background: #eef7ff;
    color: #244c68;
}

.mpas-project-intro > strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #173b55;
    font-size: 1rem;
}

.mpas-project-intro p {
    margin-bottom: 0.45rem;
    font-size: 0.84rem;
    line-height: 1.4;
}

.mpas-project-card {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d8dee4;
    border-radius: 0.35rem;
    background: #fff;
}

.mpas-project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.mpas-project-card-header h2 {
    margin: 0 0 0.25rem;
    color: #343a40;
    font-size: 0.95rem;
    font-weight: 600;
}

.mpas-project-card-header p {
    margin: 0;
    color: #6c757d;
    font-size: 0.78rem;
    line-height: 1.4;
}

.mpas-project-evidence-option {
    margin-bottom: 0.35rem;
}

.mpas-project-evidence-option .form-check-label {
    font-size: 0.82rem;
}

.mpas-project-status {
    min-height: 1.5rem;
    margin: 0.25rem 0 0.75rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid #d8dee4;
    border-radius: 0.3rem;
    background: #f8fafc;
    color: #495057;
    font-size: 0.78rem;
    line-height: 1.4;
}

.mpas-project-status.is-error {
    border-color: #f1b0b7;
    background: #fbeaec;
    color: #842029;
}

.mpas-project-review {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid #cfd7de;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.10);
}

.mpas-project-review[hidden] {
    display: none !important;
}

.mpas-project-review-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #dde3e8;
    background: #f8fafc;
}

.mpas-project-review-header h2 {
    min-width: 0;
    margin: 0;
    color: #3b444c;
    font-size: 0.92rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mpas-project-review-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.mpas-project-review-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem;
}

.mpas-project-review-message {
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #b8daff;
    border-radius: 0.3rem;
    font-size: 0.76rem;
    line-height: 1.4;
}

.mpas-project-review-message.is-ready {
    border-color: #b7dfc5;
    background: #edf8f1;
    color: #245b37;
}

.mpas-project-review-message.is-blocked {
    border-color: #f1b0b7;
    background: #fbeaec;
    color: #842029;
}

.mpas-project-review-summary {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.mpas-project-review-stat {
    min-width: 0;
    padding: 0.5rem 0.6rem;
    border: 1px solid #dce2e8;
    border-radius: 0.3rem;
    background: #f8fafc;
}

.mpas-project-review-stat-label {
    color: #6c757d;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mpas-project-review-stat-value {
    margin-top: 0.12rem;
    color: #343a40;
    font-size: 0.88rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mpas-project-review-section {
    margin-top: 0.75rem;
}

.mpas-project-review-section:first-child {
    margin-top: 0;
}

.mpas-project-review-section-title {
    margin: 0 0 0.35rem;
    color: #495057;
    font-size: 0.78rem;
    font-weight: 700;
}

.mpas-project-review-evidence-title {
    margin-bottom: 0.2rem;
    color: #343a40;
    font-size: 0.78rem;
    font-weight: 600;
}

.mpas-project-review-blockers {
    margin: 0;
    padding-left: 1.2rem;
    color: #842029;
    font-size: 0.76rem;
    line-height: 1.45;
}

.mpas-project-review-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-top: 1px solid #dde3e8;
    background: #f8fafc;
}

.mpas-project-review-footer p {
    flex: 1 1 auto;
    margin: 0;
    color: #6c757d;
    font-size: 0.7rem;
    line-height: 1.35;
}

.mpas-project-review-footer button {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .mpas-project-review-summary {
        grid-template-columns: 1fr;
    }

    .mpas-project-review-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .mpas-project-review-footer button {
        width: 100%;
    }
}

/* === MPAS PROJECT / REPRODUCIBILITY UI END === */


/* === V1.0.0 GITHUB PAGES MPCT AVAILABILITY START === */

.mpas-mesh-combobox-option-mpct-unavailable {
    border-left: 3px solid #d39e00;
    background: #fff8e1;
}

.mpas-mesh-combobox-option-mpct-unavailable:hover,
.mpas-mesh-combobox-option-mpct-unavailable.active,
.mpas-mesh-combobox-option-mpct-unavailable[aria-selected="true"] {
    background: #fff3cd;
}

.mpas-mesh-combobox-option-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
}

.mpas-mesh-combobox-option-mpct-status {
    color: #856404;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.mpas-selected-mesh-mpct-warning {
    margin-top: 0.55rem;
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    line-height: 1.35;
}

/* === V1.0.0 GITHUB PAGES MPCT AVAILABILITY END === */


/* === V1.0.0 HFUN DESIGN / PREVIEW SEPARATION START === */

.mpas-hfun-subsection {
    margin-top: 0.65rem;
}

.mpas-hfun-subsection-heading {
    margin-bottom: 0.3rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #343a40;
}

.mpas-hfun-subsection-note {
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.mpas-hfun-preview-display {
    margin-top: 0.8rem;
    padding: 0.6rem;
    border: 1px solid #d7e0e6;
    border-radius: 0.3rem;
    background: rgba(248, 251, 253, 0.78);
}

.mpas-hfun-boundary-toggle {
    margin-top: 0.55rem;
    margin-bottom: 0.45rem;
}

.mpas-hfun-boundary-grid {
    margin-top: 0.2rem;
}

.mpas-hfun-boundary-actions {
    margin-top: 0.45rem;
}

.mpas-hfun-boundary-message {
    margin-top: 0.4rem;
    line-height: 1.35;
}

/* === V1.0.0 HFUN DESIGN / PREVIEW SEPARATION END === */

/* === V1.0.0 CUSTOM MESH GENERATION G3/G4 START === */

.mpas-custom-mesh-generation-panel {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #d8dee4;
}

.mpas-custom-mesh-plot-option {
    margin-top: 0.55rem;
}

.mpas-custom-mesh-sampling-note,
.mpas-custom-mesh-generation-message {
    margin-top: 0.45rem;
    line-height: 1.35;
}

.mpas-custom-mesh-generation-message[data-kind="error"],
.mpas-custom-mesh-generation-message[data-kind="success"] {
    font-weight: 600;
}

/* === V1.0.0 CUSTOM MESH GENERATION G3/G4 END === */

/* === V1.0.0 CUSTOM MESH GENERATION TOP-LEVEL TAB START === */

/*
 * G3 originally lived beneath the Refinement Designer.  As of this
 * navigation refinement, mesh building is a first-class workflow stage:
 *
 * Mesh -> Mesh Generation -> Initialization -> Atmosphere
 */
#panel-custom-mesh-generation .mpas-custom-mesh-generation-panel {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: 0 !important;
}

#panel-custom-mesh-generation .mpas-custom-mesh-workflow-note {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #dee2e6;
}

#panel-custom-mesh-generation .mpas-custom-mesh-workflow-note > strong {
    display: block;
    margin-bottom: 0.25rem;
}

#panel-custom-mesh-generation .mpas-mesh-target-line {
    margin-top: 0.75rem;
}

/* === V1.0.0 CUSTOM MESH GENERATION TOP-LEVEL TAB END === */

/* === V1.0.0 SOURCE-AWARE MESH GENERATION START === */

.mpas-mesh-generation-source-summary {
    margin: 0.55rem 0 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #d8dee4;
    border-radius: 4px;
    background: #f8fbfd;
}

.mpas-mesh-generation-source-summary > strong {
    display: block;
    margin-bottom: 0.2rem;
}

/* === V1.0.0 SOURCE-AWARE MESH GENERATION END === */

/* === V1.0.0 OFFICIAL / CUSTOM MESH WORKFLOW SEPARATION START === */

#official-mesh-relocation-panel[hidden],
#official-mesh-relocation-panel[data-placement-mode="unavailable"]
    .mpas-hfun-designer-grid,
#official-mesh-relocation-panel[data-placement-mode="unavailable"]
    .mpas-hfun-designer-actions {
    display: none !important;
}

#official-mesh-relocation-panel[data-placement-mode="unavailable"]
    .mpas-official-relocation-intro {
    margin-bottom: 0.35rem;
}

#official-mesh-relocation-panel,
#hfun-designer-panel,
#active-mesh-source-panel {
    scroll-margin-top: 0.75rem;
}

#active-mesh-source-panel {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 2px solid #d8dee4;
}

/* === V1.0.0 OFFICIAL / CUSTOM MESH WORKFLOW SEPARATION END === */

/* === V1.0.0 G6 STATIC.NC GENERATION START === */

.mpas-static-nc-generation-panel {
    margin: 0 0 0.8rem 0;
    padding: 0 0 0.8rem 0;
    border-bottom: 1px solid #dee2e6;
}

.mpas-static-nc-source-detail,
.mpas-static-nc-help,
.mpas-static-nc-generation-message {
    margin-top: 0.45rem;
    line-height: 1.35;
}

.mpas-static-nc-generation-message[data-kind="error"],
.mpas-static-nc-generation-message[data-kind="success"] {
    font-weight: 600;
}

/* === V1.0.0 G6 STATIC.NC GENERATION END === */

/* === V1.0.0 G6 STATIC.NC LAYOUT OVERRIDE START === */

/*
 * Keep the G6 static-field workflow visually separate from the
 * source-backed namelist editor above it.
 */
.mpas-static-nc-generation-panel {
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #dee2e6;
}

#static-nc-generation-panel {
    clear: both;
    position: relative;
    z-index: 1;
}

/* === V1.0.0 G6 STATIC.NC LAYOUT OVERRIDE END === */

/* === V1.0.0 G6 STATIC FIELDS SUBPAGE START === */

/* G6 is a workflow page, not part of the scrollable namelist editor. */
.mpas-config-modal-tab-pane[data-config-modal-tab-panel="static-fields"]:not([hidden]) {
    display: block;
    overflow: auto;
    padding: 1rem 1.1rem 1.25rem;
    background: #ffffff;
}

.mpas-config-modal-tab-pane[data-config-modal-tab-panel="static-fields"]
.mpas-static-nc-generation-panel {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: relative;
    z-index: auto;
}

.mpas-config-modal-panel:not(.mpas-streams-modal-panel)
[data-config-modal-tab-panel="static-fields"]
.mpas-hfun-designer-grid {
    margin-top: 0.9rem;
}

.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="static-fields"]
.mpas-config-modal-footer-left,
.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="static-fields"]
.mpas-config-modal-footer-right
.btn-primary {
    display: none !important;
}

/* === V1.0.0 G6 STATIC FIELDS SUBPAGE END === */

/* === V1.0.0 MESH AUTHORING TABS START === */

.mpas-mesh-authoring-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0 0 0.35rem;
    padding: 0.25rem;
    border: 1px solid #d9e1e7;
    border-radius: 0.45rem;
    background: #f5f8fa;
}

.mpas-mesh-authoring-tab {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    background: transparent;
    color: #495057;
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.mpas-mesh-authoring-tab:hover,
.mpas-mesh-authoring-tab:focus {
    border-color: #b8c7d1;
    background: #ffffff;
    color: #0b5ed7;
    outline: none;
}

.mpas-mesh-authoring-tab.active,
.mpas-mesh-authoring-tab[aria-selected="true"] {
    border-color: #0d6efd;
    background: #ffffff;
    color: #0b5ed7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mpas-mesh-authoring-tabs-note {
    margin: 0 0 0.7rem;
    line-height: 1.35;
}

.mpas-mesh-authoring-page[hidden] {
    display: none !important;
}

.mpas-mesh-authoring-page {
    min-width: 0;
}

.mpas-mesh-authoring-page > :last-child {
    margin-bottom: 0;
}

/*
 * Active Mesh Source remains visible below both authoring pages.
 * Treat it as persistent status/action rather than a third page.
 */
#active-mesh-source-panel {
    margin-top: 0.75rem !important;
    padding: 0.7rem !important;
    border: 1px solid #d8dee4 !important;
    border-radius: 0.45rem;
    background: #f8fbfd;
}

#active-mesh-source-panel .mpas-active-mesh-source-intro {
    margin-bottom: 0.4rem;
}

/* === V1.0.0 MESH AUTHORING TABS END === */

/* === V1.0.0 G7 INITIAL CONDITIONS SUBPAGE START === */

.mpas-init-nc-generation-panel {
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #dee2e6;
}

#init-nc-generation-panel {
    clear: both;
    position: relative;
    z-index: 1;
}

.mpas-config-modal-tab-pane[data-config-modal-tab-panel="initial-conditions"]:not([hidden]) {
    display: block;
    overflow: auto;
    padding: 1rem 1.1rem 1.25rem;
    background: #ffffff;
}

.mpas-config-modal-tab-pane[data-config-modal-tab-panel="initial-conditions"]
.mpas-init-nc-generation-panel {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: relative;
    z-index: auto;
}

.mpas-config-modal-panel:not(.mpas-streams-modal-panel)
[data-config-modal-tab-panel="initial-conditions"]
.mpas-hfun-designer-grid {
    margin-top: 0.9rem;
}

.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="initial-conditions"]
.mpas-config-modal-footer-left,
.mpas-config-modal-panel:not(.mpas-streams-modal-panel)[data-config-modal-active-tab="initial-conditions"]
.mpas-config-modal-footer-right
.btn-primary {
    display: none !important;
}

.mpas-init-nc-checkbox {
    margin-top: 0.9rem;
}

.mpas-init-nc-help {
    margin-top: 0.8rem;
}

/* === V1.0.0 G7 INITIAL CONDITIONS SUBPAGE END === */

/* ========================================================================== */
/* V1.0.0 G8 ATMOSPHERE RUN PACKAGE SUBPAGE START                             */
/* ========================================================================== */

.mpas-run-directory-generation-panel {
    padding: 1rem;
}

.mpas-run-directory-generation-panel .mpas-mesh-section-heading {
    margin-bottom: 0.7rem;
}

.mpas-run-directory-generation-panel .mpas-hfun-designer-grid {
    margin-top: 0.8rem;
}

.mpas-run-directory-source-detail,
.mpas-run-directory-help {
    margin-top: 0.45rem;
}

.mpas-run-directory-generation-message {
    margin-top: 0.65rem;
    min-height: 1.2rem;
}

.mpas-run-directory-generation-message[data-kind="working"],
.mpas-run-directory-generation-message[data-kind="success"],
.mpas-run-directory-generation-message[data-kind="error"] {
    font-weight: 600;
}

.mpas-config-modal-panel[data-config-core="atmosphere"]
    [data-config-modal-tab-panel="run-package"] {
    overflow: auto;
}

.mpas-config-modal-panel[data-config-core="atmosphere"]
    [data-config-modal-active-tab="run-package"] {
    min-height: 0;
}

/* ========================================================================== */
/* V1.0.0 G8 ATMOSPHERE RUN PACKAGE SUBPAGE END                               */
/* ========================================================================== */



/* ============================================================
   G9 END-TO-END VALIDATION START
   ============================================================ */

.mpas-g9-validation-panel {
    border-top: 3px solid rgba(40, 167, 69, 0.55);
}

.mpas-g9-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mpas-g9-validation-message {
    margin-top: 0.75rem;
}

.mpas-g9-validation-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mpas-g9-check {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(108, 117, 125, 0.24);
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.025);
}

.mpas-g9-check-state {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.mpas-g9-check-pass .mpas-g9-check-state {
    color: #28a745;
}

.mpas-g9-check-blocked .mpas-g9-check-state {
    color: #dc3545;
}

.mpas-g9-check-information .mpas-g9-check-state {
    color: #17a2b8;
}

.mpas-g9-check-title {
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .mpas-g9-check {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

/* ============================================================
   G9 END-TO-END VALIDATION END
   ============================================================ */
