/* MALI-only presentation, derived from the working Seaice cascade. */

/* V1-M10f.2: independent MALI shell, no Ocean or Atmosphere selector changes. */
#v2-mali-workspace[hidden] { display: none !important; }
#v2-mali-workspace {
    width: min(1120px, 100%); margin: 0 auto 2rem;
    border-radius: 16px; overflow: hidden;
    background: #f7fafd; color: #21384f;
    border: 1px solid #aabed2;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
#v2-mali-workspace > header {
    padding: 1.35rem 1.65rem; background: #fff;
    border-bottom: 1px solid #d9e5ef;
}
#v2-mali-workspace h2 { margin: 0 0 .4rem; color: #193a58; font-size: 1.5rem; }
#v2-mali-workspace h3 { margin: 0 0 .65rem; color: #214d72; font-size: 1rem; }
#v2-mali-workspace p { margin: .45rem 0; }
#v2-mali-workspace .v2-mali-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
    padding: 1.15rem 1.65rem; background: #eaf2f9;
}
#v2-mali-workspace label { font-weight: 700; }
#v2-mali-workspace select {
    flex: 1 1 250px; max-width: 450px; min-width: 0;
    border: 1px solid #93adc3; border-radius: 7px;
    background: #fff; color: #21384f; padding: .65rem;
    font: inherit;
}
#v2-mali-workspace select:focus-visible,
#v2-mali-workspace button:focus-visible { outline: 3px solid #168cdb; outline-offset: 3px; }
#v2-mali-workspace select:disabled { opacity: .65; }
#v2-mali-status { padding: .6rem 1.65rem; color: #28587a; }
#v2-mali-summary { padding: .5rem 1.65rem; font-weight: 650; }
#v2-mali-workspace .v2-mali-inventories {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem; padding: 1rem 1.65rem 1.6rem;
}
#v2-mali-workspace .v2-mali-inventories > section {
    min-width: 0; background: #fff; padding: 1rem;
    border: 1px solid #d4e2ed; border-radius: 9px;
}
#v2-mali-workspace pre {
    margin: 0; max-height: 310px; overflow: auto;
    color: #2d4b64; background: #f1f6fa;
    border-radius: 6px; padding: .8rem;
    font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
#v2-mali-workspace footer { padding: .8rem 1.65rem 1.5rem; }
#v2-mali-back {
    border: 1px solid #3378a9; background: #216da6;
    border-radius: 8px; color: #fff; padding: .7rem 1rem;
    cursor: pointer; font: inherit; font-weight: 650;
}
#v2-mali-back:hover { background: #165886; }
@media (max-width: 720px) {
    #v2-mali-workspace .v2-mali-inventories { grid-template-columns: 1fr; }
}

/* V1-M10f.3: Ocean/Atmosphere-style dialog parity, scoped exclusively to MALI. */
#v2-mali-workspace #v2-mali-editor-dialog[hidden],
#v2-mali-workspace #v2-mali-editor-backdrop[hidden],
#v2-mali-workspace #v2-mali-editor-pane-validation[hidden],
#v2-mali-workspace #v2-mali-editor-pane-editor[hidden] {display:none!important}
#v2-mali-workspace .v2-mali-editor-launcher {
    margin: 0 1.65rem 0; padding: 14px 18px; background:#fff;
    border:1px solid #d4e2ed;border-radius:9px;
}
#v2-mali-workspace .v2-mali-editor-launcher p {color:#536a80;font-size:13px}
#v2-mali-workspace #v2-mali-editor-open {background:#1678bf;color:#fff;
    border:1px solid #0869a9;border-radius:6px;padding:10px 18px;font-weight:650;cursor:pointer}
#v2-mali-workspace #v2-mali-editor-open:disabled {opacity:.5;cursor:not-allowed}
#v2-mali-workspace #v2-mali-editor-backdrop {position:fixed;inset:0;z-index:90;
    background:rgba(0,0,0,.50)}
#v2-mali-workspace #v2-mali-editor-dialog {
    position:fixed;inset:2.5vh 2.5vw;z-index:91;width:95vw;height:95dvh;
    display:flex;flex-direction:column;overflow:hidden;max-width:none;max-height:none;
    margin:0;background:#fff;color:#273a4c;border:1px solid #cdd9e5;
    border-radius:9px;box-shadow:0 20px 50px rgba(0,0,0,.32);
    font:14px/1.45 -apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}
#v2-mali-workspace #v2-mali-editor-dialog button {font:inherit;cursor:pointer}
#v2-mali-workspace #v2-mali-editor-dialog button:disabled {opacity:.48;cursor:not-allowed}
#v2-mali-workspace #v2-mali-editor-dialog-header {
    display:flex;justify-content:space-between;align-items:center;gap:15px;
    padding:12px 18px;background:#f8fafc;border-bottom:1px solid #dce4ec;
}
#v2-mali-workspace #v2-mali-editor-title {font-size:22px;font-weight:500;margin:0;color:#293e52}
#v2-mali-workspace #v2-mali-editor-dialog-header p {font-size:12px;color:#65778a;margin:2px 0}
#v2-mali-workspace #v2-mali-editor-close {font-size:26px;border:0;background:transparent;
    padding:0;width:36px;height:36px;color:#4b6075;border-radius:4px}
#v2-mali-workspace #v2-mali-editor-close:hover {background:#e5edf5}
#v2-mali-workspace #v2-mali-editor-body {display:flex;flex:1 1 auto;min-height:0;min-width:0}
#v2-mali-workspace #v2-mali-editor-mode-nav {display:flex;flex-direction:column;
    flex:0 0 86px;background:#f5f8fb;border-right:1px solid #dce4ec;overflow-y:auto}
#v2-mali-workspace #v2-mali-editor-mode-nav button {display:flex;flex-direction:column;
    align-items:center;justify-content:center;gap:5px;min-height:80px;
    border:0;border-bottom:1px solid #e0e8f0;border-radius:0;
    background:transparent;color:#344f68;font-size:11px;text-align:center;padding:8px 5px}
#v2-mali-workspace #v2-mali-editor-mode-nav button i {font-size:20px}
#v2-mali-workspace #v2-mali-editor-mode-nav button[aria-pressed="true"] {
    background:#0877c5;color:#fff;box-shadow:inset 4px 0 #004d87}
#v2-mali-workspace #v2-mali-editor-main {display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}
#v2-mali-workspace #v2-mali-editor-tabs {display:flex;gap:2px;padding:5px 16px 0;
    background:#f8fafc;border-bottom:1px solid #dce4ec}
#v2-mali-workspace #v2-mali-editor-tabs button {background:transparent;color:#52677b;
    border:1px solid transparent;padding:9px 15px;border-radius:5px 5px 0 0}
#v2-mali-workspace #v2-mali-editor-tabs button[aria-selected="true"] {
    background:#fff;color:#0869b5;border-color:#dce4ec #dce4ec #fff;font-weight:700}
#v2-mali-workspace #v2-mali-editor-pane-editor,
#v2-mali-workspace #v2-mali-editor-pane-validation {min-height:0;overflow:auto;flex:1 1 auto;padding:14px 18px}
#v2-mali-workspace #v2-mali-editor-toolbar {display:flex;flex-wrap:wrap;align-items:center;gap:8px;
    margin-bottom:10px}
#v2-mali-workspace #v2-mali-editor-toolbar label {font-size:12px}
#v2-mali-workspace #v2-mali-editor-search {min-width:190px;flex:1 1 230px;
    border:1px solid #aebfd0;border-radius:5px;padding:8px;font:inherit}
#v2-mali-workspace #v2-mali-editor-toolbar button,
#v2-mali-workspace #v2-mali-editor-validate,
#v2-mali-workspace #v2-mali-editor-done {
    border:1px solid #b6c8d8;background:#f7fafc;color:#285474;border-radius:5px;padding:8px 12px}
#v2-mali-workspace #v2-mali-editor-count {font-weight:650;font-size:12px;color:#3b5e7b}
#v2-mali-workspace #v2-mali-editor-search-result,
#v2-mali-workspace #v2-mali-editor-feedback {color:#476782;font-size:12px;margin:8px 0}
#v2-mali-workspace #v2-mali-editor-records {display:grid;gap:9px;margin-top:12px}
#v2-mali-workspace .v2-mali-editor-record {border:1px solid #dce4ee;border-radius:7px;overflow:hidden}
#v2-mali-workspace .v2-mali-editor-record > summary {cursor:pointer;padding:11px 15px;
    background:#f4f7fa;color:#2a4058;font:650 13px ui-monospace,Consolas,monospace}
#v2-mali-workspace .v2-mali-editor-record[open] > summary {background:#e9f3ff;
    color:#1d5686;border-bottom:1px solid #d8e6f5}
#v2-mali-workspace .v2-mali-editor-option {display:grid;align-items:center;
    grid-template-columns:minmax(180px,1fr) minmax(210px,1.4fr) auto auto;
    gap:8px 12px;padding:13px 15px;border-bottom:1px solid #e6edf4}
#v2-mali-workspace .v2-mali-editor-option[hidden],
#v2-mali-workspace .v2-mali-editor-record[hidden] {display:none!important}
#v2-mali-workspace .v2-mali-editor-option:last-child {border-bottom:0}
#v2-mali-workspace .v2-mali-editor-option-name {grid-column:1/-1;font:700 13px ui-monospace,Consolas,monospace}
#v2-mali-workspace .v2-mali-editor-value-label {font-size:12px;color:#536a80}
#v2-mali-workspace .v2-mali-editor-value {display:block;width:100%;min-width:0;
    border:1px solid #aebfd0;border-radius:5px;padding:8px;color:#263c51;background:#fff;
    font:13px ui-monospace,Consolas,monospace}
#v2-mali-workspace .v2-mali-editor-value[aria-invalid="true"] {border-color:#c23d3d;background:#fff5f5}
#v2-mali-workspace .v2-mali-editor-include-label {display:flex;align-items:center;gap:6px;
    font-size:12px;white-space:nowrap}
#v2-mali-workspace .v2-mali-editor-reset {background:#fff;border:1px solid #c7d6e4;
    border-radius:5px;padding:7px 10px;color:#315d7e}
#v2-mali-workspace .v2-mali-editor-option-meta,
#v2-mali-workspace .v2-mali-editor-option-native {grid-column:1/-1;font-size:12px;color:#60768b}
#v2-mali-workspace .v2-mali-editor-option-desc {grid-column:1/-1;margin:0;padding:8px 12px;
    border-left:3px solid #2b80c7;background:#f0f6fc;font-size:13px;color:#29445f}
#v2-mali-workspace .v2-mali-editor-option-feedback {grid-column:1/-1;color:#a22525;font-size:12px}
#v2-mali-workspace .v2-mali-editor-dirty {border-left:3px solid #d88b22}
#v2-mali-workspace #v2-mali-editor-validation-result {white-space:pre-wrap;overflow-wrap:anywhere;
    background:#f4f8fc;padding:15px;border:1px solid #dce4ec;border-radius:6px}
#v2-mali-workspace #v2-mali-editor-dialog-footer {display:flex;align-items:center;
    justify-content:space-between;gap:12px;padding:10px 18px;border-top:1px solid #dce4ec;
    background:#f8fafc}
#v2-mali-workspace #v2-mali-editor-dialog-footer p {margin:0;font-size:12px;color:#63798d}
@media(max-width:760px){
    #v2-mali-workspace #v2-mali-editor-mode-nav {flex-basis:56px}
    #v2-mali-workspace #v2-mali-editor-mode-nav button {font-size:9px;min-height:68px}
    #v2-mali-workspace .v2-mali-editor-option {grid-template-columns:minmax(0,1fr) auto}
    #v2-mali-workspace .v2-mali-editor-value-label {grid-column:1/-1}
    #v2-mali-workspace .v2-mali-editor-option-desc {overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){#v2-mali-workspace * {scroll-behavior:auto!important}}

/* V1-M10f.3a: replicate the uploaded Atmosphere namelist option layout and
 * Ocean modal spacing. Scoped exclusively to the MALI editor DOM.
 * No change to model source, state, validation, or serialization. */
#v2-mali-workspace #v2-mali-editor-mode-nav {flex:0 0 58px;width:58px}
#v2-mali-workspace #v2-mali-editor-mode-nav button {min-height:62px;padding:5px 2px;font-size:10px;font-weight:600}
#v2-mali-workspace #v2-mali-editor-mode-nav button i {font-size:17px}
#v2-mali-workspace #v2-mali-editor-records {gap:10px}
#v2-mali-workspace .v2-mali-editor-record > summary {padding:12px 16px;font:650 14px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
#v2-mali-workspace .v2-mali-editor-option {
    display:grid;grid-template-columns:minmax(185px,19rem) minmax(230px,19rem) minmax(250px,1fr);
    align-items:start;column-gap:16px;row-gap:6px;margin:-1px 0 0;
    padding:12px 14px;border:1px solid #e1e7ed;border-left:0;border-right:0;border-radius:0;
    background:#fff;font-size:13px
}
#v2-mali-workspace .v2-mali-editor-option-identity {
    min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:12px;
    padding:12px 10px;border:1px solid #d7dde2;background:#eef1f3;
}
#v2-mali-workspace .v2-mali-editor-option-name {
    display:block;font:650 13px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    overflow-wrap:anywhere
}
#v2-mali-workspace .v2-mali-editor-include-label {font-size:12px;gap:7px}
#v2-mali-workspace .v2-mali-editor-option-controls {display:flex;min-width:0;flex-direction:column;gap:10px}
#v2-mali-workspace .v2-mali-editor-value-label {display:block;min-width:0;font-size:12px;color:#536a80}
#v2-mali-workspace .v2-mali-editor-value {margin-top:5px;padding:9px 10px}
#v2-mali-workspace .v2-mali-editor-reset {align-self:flex-start;font-size:12px;padding:7px 12px}
#v2-mali-workspace .v2-mali-editor-option-docs {min-width:0;display:flex;flex-direction:column;gap:8px}
#v2-mali-workspace .v2-mali-editor-option-desc {
    margin:0;padding:9px 12px;line-height:1.55;white-space:normal;
    border-radius:3px;overflow-wrap:anywhere
}
#v2-mali-workspace .v2-mali-editor-option-meta,
#v2-mali-workspace .v2-mali-editor-option-native {font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#v2-mali-workspace .v2-mali-editor-option-feedback {overflow-wrap:anywhere}
#v2-mali-workspace .v2-mali-editor-dirty {box-shadow:inset 3px 0 #e7ac21;background:#fffdf7}
#v2-mali-workspace #v2-mali-editor-dialog :is(button,input):focus-visible {outline:2px solid #0862bd;outline-offset:2px}
@media(max-width:1199px){
    #v2-mali-workspace .v2-mali-editor-option {grid-template-columns:minmax(175px,19rem) minmax(0,1fr)}
    #v2-mali-workspace .v2-mali-editor-option-docs {grid-column:1/-1;padding-top:6px;border-top:1px solid #edf0f2}
}
@media(max-width:767px){
    #v2-mali-workspace #v2-mali-editor-mode-nav {flex-basis:46px;width:46px}
    #v2-mali-workspace #v2-mali-editor-mode-nav button {min-height:54px;padding:3px 2px;font-size:9px}
    #v2-mali-workspace .v2-mali-editor-option {grid-template-columns:minmax(0,1fr);gap:9px}
    #v2-mali-workspace .v2-mali-editor-option-docs {grid-column:1}
}

/* Keep one rail in the workspace, alongside the same inset used by Ocean. */
#v2-mali-workspace #v2-mali-editor-mode-nav {
    display: none;
}

#v2-mali-workspace:has(#v2-mali-editor-dialog:not([hidden])) #v2-mali-page-rail {
    position: relative;
    z-index: 91;
    filter: brightness(.7);
}

#v2-mali-workspace #v2-mali-editor-dialog {
    left: max(40px, 2.5vw);
    right: 2.5vw;
    width: auto;
}

/* V1-M10f.3b: MALI page shell parity with Ocean's Atmosphere-style map/sidebar.
 * Map is geographic context from the existing inactive Atmosphere page only.
 * No MALI mesh selection, model execution, or Ocean/Atmosphere state mutation. */
#v2-module-home:has(#v2-mali-workspace:not([hidden])) {
    padding: 0; overflow: hidden; background: transparent; pointer-events: none;
}
#v2-module-home:has(#v2-mali-workspace:not([hidden])) .v2-home-wrap {
    width: 100%; max-width: none; margin: 0; padding: 0;
}
#v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-workspace {
    position: fixed; top: 0; bottom: 0; left: 0; transform: none;
    display: flex; flex-direction: row; align-items: stretch;
    width: clamp(320px, 22.5vw, 460px); max-width: 100vw; height: 100dvh;
    margin: 0; padding: 0; overflow: visible;
    background: #fff; color: #263a50; border: 0; border-right: 1px solid #becbd9;
    border-radius: 0; box-shadow: 2px 0 10px rgba(0, 0, 0, .17);
    pointer-events: auto; font: 12px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
#v2-mali-workspace #v2-mali-page-rail {
    flex: 0 0 40px; width: 40px; height: 100%; display: flex; flex-direction: column;
    background: #fff; border-right: 1px solid #e0e7ef;
}
#v2-mali-workspace #v2-mali-page-rail button {
    flex: 0 0 40px; display: block; width: 40px; height: 40px; padding: 0; margin: 0;
    border: 0; border-radius: 0; background: #fff; color: #35516b;
    text-align: center; cursor: pointer; font-size: 16px; line-height: 40px;
}
#v2-mali-workspace #v2-mali-page-rail #v2-mali-page-config {
    background: #0074d9; color: #fff;
}
#v2-mali-workspace #v2-mali-page-rail #v2-mali-page-home {
    margin-top: auto; border-top: 1px solid #e0e7ef;
}
#v2-mali-workspace #v2-mali-page-rail button:hover { background: #e7f1fb; color: #034a86; }
#v2-mali-workspace #v2-mali-page-rail #v2-mali-page-config:hover { background: #0869b5; color: #fff; }
#v2-mali-workspace #v2-mali-sidebar-column {
    flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0;
    background: #fff;
}
#v2-mali-workspace #v2-mali-sidebar-header {
    display: flex; align-items: center; gap: 6px; height: 40px; min-height: 40px;
    padding: 0 11px; background: #0074d9; color: #fff;
}
#v2-mali-workspace #v2-mali-sidebar-header h2 {
    color: #fff; font-size: 15px; margin: 0; font-weight: 650;
}
#v2-mali-workspace #v2-mali-sidebar-header span {
    border: 1px solid #c0d5e6; border-radius: 3px; background: #fff;
    color: #26507a; padding: 0 3px; font-size: 9px; font-weight: 700;
}
#v2-mali-workspace #v2-mali-sidebar-scroll {
    flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
    padding: 11px 9px 18px; background: #fff;
}
#v2-mali-workspace #v2-mali-sidebar-scroll > header {
    padding: 0 0 12px; background: transparent; border: 0;
}
#v2-mali-workspace #v2-mali-sidebar-scroll > header .v2-home-eyebrow {
    color: #527393; letter-spacing: .06em; font-size: 9px;
}
#v2-mali-workspace #v2-mali-sidebar-scroll > header h2 {
    margin: 6px 0; font-size: 13px; color: #26394c; font-weight: 750;
}
#v2-mali-workspace #v2-mali-sidebar-scroll > header p { font-size: 11px; color: #687b8d; }
#v2-mali-workspace .v2-mali-controls {
    display: block; margin: 0 0 10px; padding: 10px 8px; background: #f4f7fa;
    border: 1px solid #dce4ed; border-radius: 5px;
}
#v2-mali-workspace .v2-mali-controls label { display: block; font-size: 11px; }
#v2-mali-workspace .v2-mali-controls select {
    display: block; width: 100%; max-width: none; margin-top: 5px;
    padding: 7px 8px; font-size: 12px;
}
#v2-mali-workspace #v2-mali-status {
    margin: 0 0 8px; padding: 7px; font-size: 11px; line-height: 1.45;
    background: #f0f6fc; border-left: 3px solid #1680d1;
}
#v2-mali-workspace #v2-mali-summary {
    padding: 3px 2px; font-size: 11px; line-height: 1.5; font-weight: 600;
}
#v2-mali-workspace .v2-mali-editor-launcher {
    margin: 10px 0 0; padding: 10px 9px; border-radius: 5px;
}
#v2-mali-workspace .v2-mali-editor-launcher h3 { font-size: 12px; }
#v2-mali-workspace .v2-mali-editor-launcher p { font-size: 11px; }
#v2-mali-workspace #v2-mali-editor-open { width: 100%; padding: 9px; }
#v2-mali-workspace .v2-mali-inventories {
    grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 0;
}
#v2-mali-workspace .v2-mali-inventories > section { padding: 9px; border-radius: 5px; }
#v2-mali-workspace .v2-mali-inventories h3 { font-size: 11px; margin-bottom: 4px; }
#v2-mali-workspace .v2-mali-inventories pre { font-size: 10px; max-height: 110px; }
#v2-mali-workspace .v2-mali-sidebar-footer { padding: 8px 0; border-top: 1px solid #e0e7ef; }
#v2-mali-workspace .v2-mali-sidebar-footer #v2-mali-back { width: 100%; border-radius: 5px; padding: 8px; font-size: 11px; }
#v2-mali-workspace .v2-mali-sidebar-footer p { color: #61778c; font-size: 10px; margin: 8px 0 0; }
#v2-mali-workspace #v2-mali-editor-backdrop,
#v2-mali-workspace #v2-mali-editor-dialog { pointer-events: auto; }
#v2-module-home:has(#v2-mali-editor-dialog:not([hidden])) { pointer-events: auto; }
@media (max-width: 650px) {
    #v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-workspace { width: 100vw; }
}

/* V1-M10f.3c: MALI follows Ocean's Atmosphere sidebar isolation.
 * Keep the original V1 map mounted and its sidebar state untouched. */
body:has(#v2-module-home:not([hidden]) #v2-mali-workspace:not([hidden])) #studio-sidebar,
body:has(#v2-module-home:not([hidden]) #v2-mali-workspace:not([hidden])) #sidebar-reopen {
    visibility: hidden !important;
    pointer-events: none !important;
}
/* Match Ocean's 40px left configuration rail and status presentation. */
#v2-mali-workspace #v2-mali-page-rail button[data-mali-preset] {
    display: flex; align-items: center; justify-content: center;
    color: #31516d; background: #fff; border-bottom: 1px solid #e3e7eb;
    font-size: 17px;
}
#v2-mali-workspace #v2-mali-page-rail button[data-mali-preset][aria-pressed="true"] {
    background: #0074d9; color: #fff; box-shadow: inset 3px 0 #004d87;
}
#v2-mali-workspace #v2-mali-page-rail button[data-mali-preset]:disabled {
    opacity: .6; cursor: not-allowed;
}
#v2-mali-workspace #v2-mali-sidebar-header { padding: 0 11px; }
#v2-mali-workspace #v2-mali-sidebar-scroll > header .v2-home-eyebrow { font-size: 9px; }
/* Remove bulky inventory boxes from the primary sidebar while retaining them
 * as accessible, optional, source-only reference views. */
#v2-mali-workspace #v2-mali-source-reference { margin: 12px 0; }
#v2-mali-workspace #v2-mali-source-reference > summary {
    padding: 8px 4px; font-size: 11px; font-weight: 650;
    color: #1d5482; cursor: pointer;
}
#v2-mali-workspace #v2-mali-source-reference:not([open]) .v2-mali-inventories { display: none; }
#v2-mali-workspace #v2-mali-about {
    margin: 12px 0 24px; padding: 13px; border-radius: 8px;
    border: 1px solid #d8e3ed; background: #f6f9fc;
    color: #243a52; font-size: 12px; line-height: 1.55;
}
#v2-mali-workspace #v2-mali-about h3 { margin: 0 0 8px; font-size: 14px; color: #243a52; }
#v2-mali-workspace #v2-mali-about p { margin: 6px 0 10px; }
#v2-mali-workspace #v2-mali-editor-open { background: #0074d9; }
/* Preserve modal overlay and avoid painting the inactive Atmosphere sidebar
 * over MALI's backdrop. Browser map remains a neutral geographic reference. */
#v2-module-home:has(#v2-mali-editor-dialog:not([hidden])) { pointer-events: auto; }

/* M10f.3d: MALI-specific Ocean navigation parity, no global sidebar edits. */
#v2-mali-workspace #v2-mali-configuration-view[hidden],
#v2-mali-workspace #v2-mali-about[hidden] { display: none !important; }
#v2-mali-workspace #v2-mali-page-rail #v2-mali-page-about {
    margin-top: 8px; color: #35516b;
}
#v2-mali-workspace #v2-mali-page-rail #v2-mali-page-about[aria-pressed="true"] {
    background: #0074d9; color: #fff;
}
#v2-mali-workspace.mali-about-active #v2-mali-page-rail button[data-mali-preset][aria-pressed="true"] {
    color: #35516b; background: #fff; box-shadow: none;
}
#v2-mali-workspace #v2-mali-about:not([hidden]) {
    margin: 5px 0 0; padding: 14px 12px; overflow-wrap: anywhere;
}
#v2-mali-workspace #v2-mali-about a { color: #0868ae; text-decoration: underline; }
#v2-mali-workspace #v2-mali-about-title:focus { outline: none; }
#v2-mali-workspace #v2-mali-about-title:focus-visible { outline: 2px solid #168cdb; }
/* Presets are selected from the configuration panel. */
#v2-mali-workspace #v2-mali-page-home,
#v2-mali-workspace #v2-mali-back { display: none !important; }
#v2-mali-mode-home { display: none; }
#v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-mode-home {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    position: fixed; top: .7rem; right: .7rem; z-index: 10;
    padding: .6rem .9rem; border: 1px solid #4b7dac; border-radius: 12px;
    background: linear-gradient(145deg, #24609a, #193a68); color: #fff;
    font: 700 .87rem -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 4px 0 #0c2341, 0 9px 18px rgba(0,0,0,.32);
    cursor: pointer; pointer-events: auto;
}
#v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-mode-home:hover { filter: brightness(1.14); }
#v2-module-home:has(#v2-mali-editor-dialog:not([hidden])) #v2-mali-mode-home { display: none; }
@media (max-width:650px) {
    #v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-mode-home {
        top: auto; right: .8rem; bottom: .8rem;
    }
}

/* Compact MALI sidebar; native preset controls are visible. */
#v2-mali-workspace #v2-mali-reference-view[hidden] {display: none !important;}
#v2-mali-workspace #v2-mali-page-reference {
    color: #35516b; border-bottom: 1px solid #e0e7ef;
}
#v2-mali-workspace #v2-mali-page-reference[aria-pressed="true"] {
    color: white; background: #0074d9; box-shadow: inset 3px 0 #004d87;
}
#v2-mali-workspace #v2-mali-sidebar-scroll #v2-mali-configuration-view > header {
    padding: 0 1px 12px; margin-bottom: 10px; border-bottom: 1px solid #e2e8ef;
}
#v2-mali-workspace #v2-mali-configuration-view > header #v2-mali-title {
    margin: 0 0 7px; font-size: 13px; line-height: 1.35; font-weight: 750; color: #263a50;
}
#v2-mali-workspace #v2-mali-configuration-view > header p {
    margin: 0 0 6px; color: #667b8e; font-size: 11px; line-height: 1.45;
}
#v2-mali-workspace #v2-mali-configuration-view > header .v2-mali-map-context {
    padding-left: 8px; border-left: 2px solid #b6d5f3;
}
#v2-mali-workspace #v2-mali-status {
    font-size: 11px; margin: 3px 0 8px; padding: 8px;
}
#v2-mali-workspace #v2-mali-summary {
    font-size: 11px; margin: 4px 0; padding: 8px;
    border: 1px solid #dce9f5; background: #eef5fc; border-left: 3px solid #1680d1;
    border-radius: 3px;
}
#v2-mali-workspace #v2-mali-reference-view {padding: 4px 0 16px;}
#v2-mali-workspace #v2-mali-reference-title {
    color: #263a50; font-size: 15px; margin: 5px 0 7px;
}
#v2-mali-workspace #v2-mali-reference-view > p {
    color: #687b8d; margin: 0 0 12px; font-size: 11px;
}
#v2-mali-workspace #v2-mali-source-reference {margin: 0;}
#v2-mali-workspace #v2-mali-reference-title:focus {outline: none;}
#v2-mali-workspace #v2-mali-reference-title:focus-visible {outline: 2px solid #168cdb;}
#v2-mali-workspace.mali-reference-active #v2-mali-page-rail button[data-mali-preset][aria-pressed="true"] {
    color: #35516b; background: white; box-shadow: none;
}

/* Full-width header and active rail, matching the shared Seaice/Ocean styles. */
#v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-workspace {box-sizing:border-box;padding-top:40px;}
#v2-mali-workspace #v2-mali-sidebar-column {position:static;}
#v2-mali-workspace #v2-mali-sidebar-header {position:absolute;inset:0 0 auto 0;z-index:4;box-sizing:border-box;width:100%;height:40px;min-height:40px;margin:0;padding:0 40px 0 12px;background:#0074d9;}
#v2-mali-workspace #v2-mali-sidebar-collapse {position:absolute;top:0;right:0;width:40px;height:40px;margin:0;padding:0;border:0;color:#fff;background:transparent;font-size:16px;cursor:pointer;}
#v2-mali-workspace #v2-mali-sidebar-collapse:hover {background:rgba(255,255,255,.15);}
#v2-mali-workspace #v2-mali-sidebar-collapse:focus-visible {outline:2px solid #fff;outline-offset:-3px;}
#v2-module-home:has(#v2-mali-workspace:not([hidden])) #v2-mali-workspace.is-collapsed {width:40px;padding-top:0;border-right:0;}
#v2-mali-workspace.is-collapsed #v2-mali-sidebar-column,#v2-mali-workspace #v2-mali-page-rail #v2-mali-sidebar-expand[hidden],#v2-mali-workspace [hidden] {display:none!important;}
#v2-mali-workspace {--sidebar-icon-active:#07569e;--sidebar-icon-hover:#e7f1fb;--sidebar-icon-hover-text:#034a86;}
#v2-mali-workspace #v2-mali-page-rail #v2-mali-page-config {background:#fff;color:#31516d;}
#v2-mali-workspace #v2-mali-page-rail button:is([data-mali-preset],#v2-mali-page-about,#v2-mali-page-reference):where(:hover:not(:disabled)) {background:var(--sidebar-icon-hover);color:var(--sidebar-icon-hover-text);}
#v2-mali-workspace #v2-mali-page-rail button:is([data-mali-preset],#v2-mali-page-about,#v2-mali-page-reference)[aria-pressed="true"] {background:var(--sidebar-icon-active);color:#fff;}
#v2-mali-workspace #v2-mali-page-rail button:focus-visible {outline:2px solid #987000;outline-offset:-3px;}
/* MALI native dialog uses the same inset and layout, with native focus trapping. */
#v2-mali-workspace dialog#v2-mali-editor-dialog {box-sizing:border-box;padding:0;max-width:none;max-height:none;pointer-events:auto;}
#v2-mali-workspace dialog#v2-mali-editor-dialog:not([open]) {display:none;}
#v2-mali-workspace dialog#v2-mali-editor-dialog::backdrop {background:rgba(0,0,0,.50);}
#v2-mali-workspace #v2-mali-editor-dialog-footer button,#mali-stream-open {border:1px solid #b6c8d8;background:#f7fafc;color:#285474;border-radius:5px;padding:8px 12px;cursor:pointer;}
#v2-mali-workspace #v2-mali-editor-dialog-footer {flex-wrap:wrap;}
#v2-mali-workspace #v2-mali-editor-dialog-footer p {flex:1 1 240px;}
#v2-mali-workspace .v2-mali-editor-value {box-sizing:border-box;max-width:none;}
#v2-mali-workspace .mali-stream-content {flex:1;min-height:0;overflow:auto;padding:14px 18px;}
#v2-mali-workspace .mali-stream-content pre {white-space:pre;overflow:auto;max-height:none;overflow-wrap:normal;padding:12px;background:#f4f8fc;border:1px solid #dce4ec;border-radius:6px;}
#v2-module-home:has(#v2-mali-editor-dialog[open]) #v2-component-map-host {pointer-events:none;}

/* Structured read-only Streams inventory, using the existing record styling. */
#v2-mali-workspace .mali-stream-content {display:flex;flex-direction:column;gap:10px;}
#v2-mali-workspace .mali-stream-content > * {flex-shrink:0;}
#v2-mali-workspace .mali-stream-toolbar {display:flex;gap:8px;flex-wrap:wrap;}
#v2-mali-workspace .mali-stream-toolbar button {border:1px solid #b6c8d8;background:#f7fafc;color:#285474;border-radius:5px;padding:8px 12px;cursor:pointer;}
#v2-mali-workspace .mali-stream-details {padding:12px 16px;overflow-wrap:anywhere;}
#v2-mali-workspace .mali-stream-details h4 {margin:8px 0;color:#26394c;}
#v2-mali-workspace .mali-stream-attributes {display:grid;grid-template-columns:minmax(100px,1fr) minmax(0,2fr);gap:6px 12px;margin:0;}
#v2-mali-workspace .mali-stream-attributes dt {font-weight:600;}
#v2-mali-workspace .mali-stream-attributes dd {margin:0;font-family:monospace;}
#v2-mali-workspace .mali-stream-details ul {padding-left:20px;margin:8px 0;}
#v2-mali-workspace .mali-stream-details li {padding:3px 0;font-family:monospace;}
