/*
|--------------------------------------------------------------------------
| GURISTAS.NET — VENAL INTELLIGENCE MAP
|--------------------------------------------------------------------------
*/

.venal-body {
    min-height: 100vh;
}

.venal-site-header {
    position: relative;
}

.venal-map-shell {
    --venal-bg: #030506;
    --venal-map-accent: #ff6a00;
    --venal-map-hot: #ffae63;
    --venal-map-muted: #8b959c;
    --venal-map-danger: #ff4c40;

    position: relative;
    z-index: 1;

    width: 100%;
    height: calc(100vh - var(--header-height, 78px));
    min-height: 620px;

    overflow: hidden;

    background: var(--venal-bg);
    border-top: 1px solid var(--line, rgba(255, 106, 0, 0.18));
}

.venal-map-canvas {
    position: absolute;
    inset: 0;
}

.venal-map-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.venal-hud {
    position: absolute;
    inset: 0;
    z-index: 20;

    pointer-events: none;
}

.venal-panel {
    pointer-events: auto;

    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--panel-solid, #080808) 92%, transparent),
            rgba(2, 3, 4, 0.94)
        );

    border: 1px solid var(--line-strong, rgba(255, 106, 0, 0.42));
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(11px);
}

.venal-title-panel {
    position: absolute;
    top: 18px;
    left: 18px;

    min-width: 300px;
    max-width: min(460px, calc(100vw - 310px));

    padding: 15px 17px 14px;

    border-left: 3px solid var(--accent, var(--venal-map-accent));
}

.venal-kicker {
    margin: 0 0 7px;

    color: var(--accent-bright, var(--venal-map-hot));

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.venal-title-panel h1 {
    margin: 0;

    color: var(--text, #f3f3f3);

    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    line-height: 1;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.venal-status {
    margin: 9px 0 0;

    color: var(--muted, var(--venal-map-muted));

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.4;
}

.venal-controls {
    position: absolute;
    top: 18px;
    right: 18px;

    width: 280px;
    padding: 12px;
}

.venal-search-wrap {
    display: flex;
    gap: 6px;

    margin-bottom: 10px;
}

.venal-search-wrap input,
.venal-controls select {
    min-width: 0;

    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--button-radius, 0);

    background: rgba(255, 255, 255, 0.045);
    color: var(--text, #f3f3f3);

    outline: none;
}

.venal-search-wrap input {
    width: 100%;
    padding: 8px 9px;
}

.venal-controls select {
    width: 100%;
    padding: 7px 8px;
}

.venal-search-wrap input:focus,
.venal-controls select:focus {
    border-color: var(--accent-bright, #ff9b3d);
}

.venal-controls button,
.venal-source-button,
.venal-source-heading button {
    border: 1px solid var(--line-strong, rgba(255, 106, 0, 0.48));
    border-radius: var(--button-radius, 0);

    background: var(--secondary-button-background, rgba(255, 106, 0, 0.055));
    color: var(--accent-pale, #ffd0a0);
}

.venal-controls button:hover,
.venal-source-button:hover,
.venal-source-heading button:hover {
    background: color-mix(in srgb, var(--accent, #ff6a00) 18%, transparent);
}

.venal-search-wrap button {
    padding: 7px 10px;
}

.venal-control-row,
.venal-control-stack {
    border-top: 1px solid rgba(255, 255, 255, 0.055);

    color: color-mix(in srgb, var(--text, #fff) 82%, transparent);

    font-size: 0.72rem;
}

.venal-control-row {
    min-height: 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.venal-control-stack {
    display: grid;
    gap: 7px;

    padding: 9px 0;
}

.venal-control-stack > span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.venal-control-stack small {
    color: var(--faint, #777);
    font-size: 0.62rem;
    line-height: 1.35;
}

.venal-control-row input[type="checkbox"],
.venal-control-stack input[type="range"] {
    accent-color: var(--accent, #ff6a00);
}

.venal-control-stack input[type="range"] {
    width: 100%;
}

.venal-reset-row {
    padding-top: 7px;
}

.venal-reset-row button {
    padding: 6px 10px;
}

.venal-info {
    position: absolute;
    left: 18px;
    bottom: 18px;

    width: 320px;
    min-height: 132px;

    padding: 14px 15px;

    opacity: 0;
    transform: translateY(14px);

    transition: opacity 150ms ease, transform 150ms ease;
}

.venal-info.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.venal-info-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.venal-info-heading strong {
    color: var(--text, #fff);

    font-size: 1.2rem;
    letter-spacing: 0.08em;
}

.venal-info-heading span {
    color: var(--venal-map-danger);

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.82rem;
}

.venal-info-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 13px;

    margin-top: 11px;

    font-size: 0.68rem;
}

.venal-info-grid .k {
    color: var(--muted, #999);
}

.venal-info-grid .v {
    overflow-wrap: anywhere;

    color: color-mix(in srgb, var(--text, #fff) 90%, transparent);
    text-align: right;
}

.venal-legend {
    position: absolute;
    right: 18px;
    bottom: 18px;

    width: 230px;

    display: grid;
    gap: 7px;

    padding: 11px 12px;

    color: var(--muted, #999);

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.62rem;
}

.venal-legend strong {
    color: var(--accent-bright, #ff9b3d);
    letter-spacing: 0.09em;
}

.venal-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-line {
    width: 30px;
    height: 0;

    display: inline-block;

    border-top: 1px solid var(--accent, #ff6a00);
}

.legend-dashed {
    border-top-style: dashed;
}

.legend-dotted {
    border-top-style: dotted;
    opacity: 0.55;
}

.venal-activity-legend {
    margin-top: 2px;
    padding-top: 7px;

    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.venal-help {
    position: absolute;
    right: 266px;
    bottom: 21px;

    color: rgba(190, 202, 210, 0.48);

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.6rem;
    line-height: 1.5;
    text-align: right;
    text-shadow: 0 1px 2px #000;
}

.venal-source-wrap {
    position: absolute;
    left: 18px;
    top: 151px;

    pointer-events: auto;
}

.venal-source-button {
    padding: 6px 9px;

    opacity: 0.72;

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
}

.venal-source-button:hover,
.venal-source-button[aria-expanded="true"] {
    opacity: 1;
}

.venal-source-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;

    width: min(390px, calc(100vw - 36px));
    max-height: 340px;

    overflow: auto;

    padding: 12px;
}

.venal-source-panel[hidden] {
    display: none;
}

.venal-source-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 8px;

    color: var(--accent-bright, #ff9b3d);

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
}

.venal-source-heading button {
    width: 26px;
    height: 26px;
}

.venal-source-entry {
    display: grid;
    gap: 3px;

    padding: 9px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.06);

    font-size: 0.66rem;
}

.venal-source-entry strong {
    color: var(--text, #fff);
}

.venal-source-entry code,
.venal-source-entry span {
    color: var(--muted, #999);
}

.venal-tooltip {
    position: fixed;
    z-index: 1200;

    display: none;

    pointer-events: none;

    padding: 6px 8px;

    border: 1px solid var(--line-strong, rgba(255, 106, 0, 0.42));
    background: rgba(2, 5, 6, 0.94);
    color: #f3f6f8;

    font-size: 0.72rem;

    transform: translate(13px, 13px);
    white-space: nowrap;
}

.venal-tooltip .sec {
    margin-left: 5px;
    color: #ff6659;
}

.system-label-anchor,
.boundary-label-anchor {
    pointer-events: none;
    user-select: none;
}

.system-label,
.boundary-label {
    position: relative;

    display: inline-block;

    color: rgba(235, 241, 244, 0.88);

    font-size: 10px;
    letter-spacing: 0.035em;
    text-shadow: 0 1px 3px #000, 0 0 5px #000;
    white-space: nowrap;

    transform: translate(12px, -13px);

    transition: opacity 100ms linear;
}

.system-label::before,
.boundary-label::before {
    content: "";

    position: absolute;
    left: -10px;
    top: 9px;

    width: 8px;
    height: 1px;

    background: rgba(255, 107, 16, 0.5);

    transform: rotate(-28deg);
    transform-origin: right center;
}

.system-label.is-selected {
    color: #fff0e4;

    font-size: 12px;
    font-weight: 700;
}

.boundary-label {
    color: rgba(184, 194, 201, 0.55);
    font-size: 9px;
}

.boundary-label::before {
    background: rgba(184, 194, 201, 0.3);
}

.venal-error-box {
    position: absolute;
    z-index: 100;
    left: 50%;
    top: 50%;

    width: min(620px, calc(100vw - 36px));

    padding: 18px;

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

.venal-error-box[hidden] {
    display: none;
}

.venal-error-box h2 {
    margin: 0 0 8px;
    color: #ff9d67;
    font-size: 1rem;
}

.venal-error-box p {
    margin: 6px 0;
    color: #c9d1d6;
    font-size: 0.76rem;
    line-height: 1.45;
}

#errorDetail {
    color: #87939b;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

@media (max-width: 820px) {
    .venal-map-shell {
        height: calc(100dvh - 118px);
        min-height: 640px;
    }

    .venal-title-panel {
        top: 12px;
        left: 12px;

        width: min(330px, calc(100% - 24px));
        max-width: none;
        min-width: 0;
    }

    .venal-controls {
        top: auto;
        right: 12px;
        bottom: 12px;

        width: 250px;
    }

    .venal-info {
        left: 12px;
        bottom: 12px;

        width: calc(100% - 286px);
        min-width: 210px;
    }

    .venal-legend,
    .venal-help {
        display: none;
    }

    .venal-source-wrap {
        top: 137px;
        left: 12px;
    }
}

@media (max-width: 620px) {
    .venal-map-shell {
        height: calc(100dvh - 126px);
        min-height: 720px;
    }

    .venal-title-panel {
        right: 10px;
        left: 10px;

        width: auto;
    }

    .venal-controls {
        right: 10px;
        bottom: 10px;
        left: 10px;

        width: auto;
    }

    .venal-info {
        top: 145px;
        right: 10px;
        bottom: auto;
        left: 10px;

        width: auto;
        min-width: 0;
    }

    .venal-source-wrap {
        display: none;
    }
}

/* =========================================================
   UPDATE 3 — ACTIVITY HEAT + READABLE NATIVE SELECT MENUS
   ========================================================= */

/* Edge/Chromium can render the expanded native option list using the OS
   palette. Explicitly request a dark control palette and style the option
   rows so light Guristas theme text never disappears on a white menu. */
.venal-controls select {
    color-scheme: dark;
    background-color: #090a0b;
    color: #f5eee7;
}

.venal-controls select option,
.venal-controls select optgroup {
    background-color: #090a0b;
    color: #f5eee7;
}

.venal-controls select optgroup {
    color: #ffae63;
    font-weight: 700;
}

.activity-node-anchor {
    pointer-events: none;
    user-select: none;
}

.activity-node {
    --activity-node-size: 20px;
    --activity-node-color: #ff6a00;
    --activity-font-size: 9px;

    width: var(--activity-node-size);
    height: var(--activity-node-size);

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 245, 235, 0.78);
    border-radius: 999px;

    background: var(--activity-node-color);
    color: #ffffff;

    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.75),
        0 0 12px color-mix(in srgb, var(--activity-node-color) 72%, transparent);

    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: var(--activity-font-size);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);

    transition:
        width 120ms ease,
        height 120ms ease,
        background-color 120ms ease,
        box-shadow 120ms ease,
        border-color 120ms ease;
}

.activity-node[hidden] {
    display: none !important;
}

.activity-node.is-hovered {
    border-color: #ffffff;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.18),
        0 0 18px color-mix(in srgb, var(--activity-node-color) 88%, transparent);
}

.activity-node.is-selected {
    border-width: 2px;
    border-color: #fff7ef;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.2),
        0 0 22px color-mix(in srgb, var(--activity-node-color) 96%, transparent);
}

/* Make room for the numeric bubble while preserving the existing leader line. */
.system-label.has-activity-badge {
    transform: translate(28px, -21px);
}

.venal-activity-scale {
    display: grid;
    gap: 5px;

    margin-top: 2px;
    padding-top: 7px;

    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.venal-activity-scale[hidden] {
    display: none !important;
}

.venal-activity-scale-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 7px;
}

.venal-activity-scale-row span {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
}

.venal-activity-scale-bar {
    --activity-scale-end: #ff1515;

    height: 6px;
    display: block;

    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(
        90deg,
        var(--accent, #ff6a00),
        var(--activity-scale-end)
    );
}

.venal-activity-scale small {
    color: var(--faint, #777);
    font-size: 0.54rem;
    line-height: 1.3;
}

.venal-controls select:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}
