/* Isolated styles for the sprite-based refinery map. */
html.rfso-fullpage,
html.rfso-fullpage body {
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

html.rfso-fullpage body > .footer,
html.rfso-fullpage body > .cleaner,
html.rfso-fullpage .container > h1,
html.rfso-fullpage .container > .last_update {
    display: none;
}

html.rfso-fullpage body > .container,
html.rfso-fullpage .rfso-page {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    background: none;
    overflow: visible;
}

#rfso-map {
    --rfso-bg: #06171c;
    --rfso-panel: #0a2027;
    --rfso-line: #24505c;
    --rfso-text: #e0f2f5;
    --rfso-muted: #9fbcc5;
    --rfso-cyan: #64e6ed;
    --rfso-orange: #ffc180;
    --rfso-green: #96e8b7;
    --rfso-toolbar-bottom: 82px;
    --rfso-breadcrumbs-bottom: 52px;
    --rfso-page-top: 60px;
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 78vh;
    min-height: 540px;
    max-height: 1000px;
    margin: 18px 0;
    overflow: hidden;
    border: 1px solid var(--rfso-line);
    background: var(--rfso-bg);
    color: var(--rfso-text);
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    color-scheme: dark;
}

html.rfso-fullpage #rfso-map {
    position: fixed;
    z-index: 10;
    inset: var(--rfso-page-top) 0 0;
    width: 100%;
    height: calc(100vh - var(--rfso-page-top));
    height: calc(100dvh - var(--rfso-page-top));
    min-height: 0;
    max-height: none;
    margin: 0;
    border: 0;
}

html.rfso-fullpage #rfso-map .rfso-toolbar {
    top: var(--rfso-breadcrumbs-bottom);
}

html.rfso-fullpage #rfso-map:fullscreen {
    inset: 0;
    height: 100vh;
    height: 100dvh;
}

#rfso-map *,
#rfso-map *::before,
#rfso-map *::after {
    box-sizing: border-box;
}

#rfso-map [hidden] {
    display: none !important;
}

#rfso-map .rfso-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
}

#rfso-map .rfso-labels {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

#rfso-map .rfso-node-label {
    position: absolute;
    display: block;
    max-height: 58px;
    margin: 0;
    padding: 3px 4px;
    overflow: hidden;
    transform: translate(-50%, 0);
    background: #071a21;
    color: #f1fcff;
    font: 600 14px/1.3 Arial, sans-serif;
    text-align: center;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
    pointer-events: none;
}

#rfso-map .rfso-node-kind {
    display: block;
    margin: 0 0 2px;
    overflow: hidden;
    color: #9edce7;
    font: 700 10px/12px Arial, sans-serif;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}

#rfso-map .rfso-node-name {
    display: -webkit-box;
    max-height: 36.4px;
    overflow: hidden;
    color: inherit;
    font: inherit;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    pointer-events: none;
}

#rfso-map .rfso-selection-outline {
    position: absolute;
    z-index: 1;
    border: 3px solid #b4ffff;
    box-shadow: 0 0 0 2px #071a21, 0 0 14px #64e6ed80;
    pointer-events: none;
}

#rfso-map .rfso-node-label.is-selected {
    z-index: 2;
    background: #b4ffff;
    color: #062126;
}

#rfso-map .rfso-node-label.is-selected .rfso-node-kind {
    color: #17515a;
}

#rfso-map .rfso-node-label.is-muted {
    background: #14191b;
    color: #a2a2a2;
}

#rfso-map .rfso-node-label.is-muted .rfso-node-kind {
    color: #929292;
}

#rfso-map .rfso-toolbar {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid var(--rfso-line);
    background: var(--rfso-panel);
    box-shadow: 0 4px 18px #0005;
}

#rfso-map .rfso-brand {
    flex: 0 0 auto;
    padding: 0 10px 0 3px;
    color: var(--rfso-cyan);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .12em;
    white-space: nowrap;
}

#rfso-map .rfso-search {
    appearance: none;
    flex: 1 1 190px;
    min-width: 130px;
    max-width: 340px;
    width: auto;
    height: 36px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #38606a;
    border-radius: 2px;
    background: #05161c;
    color: var(--rfso-text);
    font: inherit;
    box-shadow: none;
}

#rfso-map .rfso-search::placeholder {
    color: var(--rfso-muted);
    opacity: 1;
}

#rfso-map button {
    appearance: none;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #365d67;
    border-radius: 2px;
    background: #102f38;
    color: var(--rfso-text);
    font: inherit;
    font-weight: normal;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
}

#rfso-map button:hover {
    border-color: var(--rfso-cyan);
    background: #193f49;
    color: #fff;
}

#rfso-map button[aria-pressed="true"],
#rfso-map button.is-active {
    border-color: var(--rfso-cyan);
    background: #174650;
    color: #b8fbff;
}

#rfso-map button:disabled {
    opacity: .45;
    cursor: default;
}

#rfso-map button:focus-visible,
#rfso-map input:focus-visible,
#rfso-map a:focus-visible,
#rfso-map .rfso-canvas:focus-visible {
    outline: 2px solid var(--rfso-cyan);
    outline-offset: 3px;
}

#rfso-map .rfso-legend {
    position: absolute;
    z-index: 2;
    left: 14px;
    top: var(--rfso-toolbar-bottom);
    display: flex;
    flex-wrap: wrap;
    gap: 7px 15px;
    max-width: calc(100% - 28px);
    padding: 6px 9px;
    background: #06171cec;
    color: var(--rfso-muted);
    font-size: 11px;
    pointer-events: none;
}

#rfso-map .rfso-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#rfso-map .rfso-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border: 1px solid currentColor;
    background: currentColor;
}

#rfso-map .rfso-legend .rfso-resource {
    color: var(--rfso-cyan);
}

#rfso-map .rfso-legend .rfso-process {
    color: var(--rfso-orange);
}

#rfso-map .rfso-legend .rfso-product {
    color: var(--rfso-green);
}

#rfso-map .rfso-status,
#rfso-map .rfso-help {
    position: absolute;
    z-index: 2;
    left: 12px;
    max-width: calc(100% - 24px);
    margin: 0;
    padding: 5px 9px;
    background: #06171cef;
    color: var(--rfso-muted);
    font-size: 11px;
    line-height: 1.5;
    pointer-events: none;
}

#rfso-map .rfso-status {
    bottom: 12px;
    color: #c1dce2;
    font-variant-numeric: tabular-nums;
}

#rfso-map .rfso-help {
    bottom: 43px;
    max-width: min(600px, calc(100% - 24px));
}

#rfso-map .rfso-panel {
    position: absolute;
    z-index: 3;
    top: var(--rfso-toolbar-bottom);
    right: 12px;
    width: 330px;
    max-width: calc(100% - 24px);
    max-height: calc(100% - var(--rfso-toolbar-bottom) - 48px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #457681 #102830;
    border: 1px solid #47727d;
    border-top: 2px solid var(--rfso-cyan);
    background: var(--rfso-panel);
    box-shadow: 0 8px 24px #0007;
}

#rfso-map .rfso-panel-head {
    position: sticky;
    z-index: 1;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--rfso-line);
    background: #0d2932;
}

#rfso-map .rfso-panel-head h2,
#rfso-map .rfso-selection-title {
    margin: 0;
    padding: 0;
    border: 0;
    color: #e4fbff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    overflow-wrap: anywhere;
}

#rfso-map .rfso-panel-head button {
    align-self: flex-start;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 4px;
    font-size: 18px;
}

#rfso-map .rfso-detail-content,
#rfso-map .rfso-chain-summary {
    padding: 12px;
    color: #c9dde2;
    overflow-wrap: anywhere;
}

#rfso-map .rfso-detail-content:empty,
#rfso-map .rfso-chain-summary:empty,
#rfso-map .rfso-chain-list:empty {
    display: none;
}

#rfso-map .rfso-detail-content p {
    margin: 0 0 12px;
    color: inherit;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
}

#rfso-map .rfso-detail-content p:last-child {
    margin-bottom: 0;
}

#rfso-map .rfso-detail-content a {
    color: var(--rfso-cyan);
    text-decoration: underline;
}

#rfso-map .rfso-detail-content img {
    max-width: 100%;
    height: auto;
}

#rfso-map .rfso-detail-content table {
    width: 100%;
    margin: 0 0 12px;
    border: 0;
    border-collapse: collapse;
    background: transparent;
    font-size: 12px;
    line-height: 1.45;
}

#rfso-map .rfso-detail-content th,
#rfso-map .rfso-detail-content td {
    padding: 7px 4px;
    border: 0;
    border-bottom: 1px solid #25434d;
    background: transparent;
    color: inherit;
    font-size: inherit;
    vertical-align: top;
    text-align: left;
}

#rfso-map .rfso-detail-content th {
    font-weight: normal;
}

#rfso-map .rfso-detail-content td {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#rfso-map .rfso-detail-content .nadpis {
    padding-top: 13px;
    color: #d8f4fa;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .04em;
    text-transform: uppercase;
}

#rfso-map .rfso-detail-content .input .nadpis {
    color: var(--rfso-orange);
}

#rfso-map .rfso-detail-content .output .nadpis {
    color: var(--rfso-green);
}

#rfso-map .rfso-chain-summary {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 1px solid var(--rfso-line);
    color: var(--rfso-muted);
    font-size: 12px;
}

#rfso-map .rfso-chain-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0 12px 12px;
    list-style: none;
}

#rfso-map .rfso-chain-list button {
    width: 100%;
    justify-content: flex-start;
    min-height: 34px;
    padding: 7px 8px;
    text-align: left;
    white-space: normal;
}

#rfso-map .rfso-chain-list img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

#rfso-map .rfso-tooltip {
    position: absolute;
    z-index: 5;
    max-width: min(320px, calc(100% - 24px));
    max-height: calc(100% - 36px);
    overflow: hidden;
    padding: 10px 12px;
    border: 1px solid #47727d;
    background: #0a2027f5;
    box-shadow: 0 5px 18px #0006;
    color: var(--rfso-text);
    pointer-events: none;
}

#rfso-map .rfso-loading,
#rfso-map .rfso-error {
    position: absolute;
    z-index: 6;
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 40px);
    padding: 18px 22px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--rfso-line);
    background: var(--rfso-panel);
    color: var(--rfso-text);
    text-align: center;
    box-shadow: 0 10px 32px #0008;
}

#rfso-map .rfso-error {
    border-color: #a96455;
    color: #ffd0be;
}

#rfso-map .rfso-error button {
    margin: 10px auto 0;
}

#rfso-map:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    max-height: none;
    margin: 0;
    border: 0;
}

@media (max-width: 900px) {
    #rfso-map .rfso-toolbar {
        gap: 5px;
    }

    #rfso-map .rfso-brand {
        padding-right: 3px;
    }

    #rfso-map .rfso-search {
        flex-basis: 150px;
        max-width: 250px;
    }

    #rfso-map .rfso-toolbar button {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 12px;
    }

    #rfso-map .rfso-panel {
        width: 300px;
    }
}

@media (max-width: 600px) {
    #rfso-map {
        height: 76vh;
        height: 76dvh;
        min-height: 430px;
        max-height: 900px;
        margin: 12px 0;
    }

    #rfso-map .rfso-toolbar {
        top: 7px;
        left: 7px;
        right: 7px;
        gap: 5px;
        padding: 6px;
    }

    #rfso-map .rfso-brand {
        display: none;
    }

    #rfso-map .rfso-search {
        flex: 1 1 100%;
        min-width: 100px;
        max-width: none;
        height: 36px;
        font-size: 16px;
    }

    #rfso-map .rfso-toolbar button {
        flex: 1 0 auto;
        min-width: 36px;
        min-height: 38px;
        padding: 6px 7px;
        font-size: 11px;
    }

    #rfso-map .rfso-panel {
        top: auto;
        right: 7px;
        bottom: 40px;
        left: 7px;
        width: auto;
        max-width: none;
        max-height: min(43%, calc(100% - var(--rfso-toolbar-bottom) - 48px));
    }

    #rfso-map .rfso-panel-head {
        padding: 8px 10px;
    }

    #rfso-map .rfso-panel-head h2,
    #rfso-map .rfso-selection-title {
        font-size: 14px;
    }

    #rfso-map .rfso-detail-content {
        padding: 10px;
    }

    #rfso-map .rfso-status,
    #rfso-map .rfso-help {
        left: 7px;
        max-width: calc(100% - 14px);
        padding: 4px 6px;
        font-size: 10px;
    }

    #rfso-map .rfso-status {
        bottom: 7px;
    }

    #rfso-map .rfso-help {
        bottom: 37px;
        max-width: calc(100% - 14px);
    }

    #rfso-map .rfso-legend {
        left: 7px;
        padding: 4px 6px;
        font-size: 10px;
        gap: 6px 10px;
    }

    #rfso-map:fullscreen {
        height: 100dvh;
        max-height: none;
        min-height: 0;
        margin: 0;
    }
}
