
* {
    box-sizing: border-box;
}

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

    background: #05080a;
    color: #e8f1f4;

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

#topbar {
    height: 72px;

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

    padding: 0 18px;

    background:
        linear-gradient(
            90deg,
            #071017 0%,
            #111015 65%,
            #25100b 100%
        );

    border-bottom:
        1px solid #66311d;
}

.brand-title {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 2px;
}

.brand-subtitle {
    margin-top: 2px;
    color: #ff9d43;
    font-size: 13px;
}

.top-stats {
    display: flex;
    gap: 25px;

    font-size: 13px;
    color: #b9d0db;
}

.top-stats strong {
    color: #ffb25c;
}

#workspace {
    height:
        calc(100vh - 72px);

    display: grid;

    grid-template-columns:
        290px 1fr 0;
}

#sidebar {
    overflow-y: auto;

    background:
        rgba(
            5,
            17,
            25,
            .98
        );

    border-right:
        1px solid #27414c;
}

#sidebar section {
    padding: 16px;

    border-bottom:
        1px solid #20343d;
}

h2,
h3 {
    margin:
        0 0 10px 0;
}

h2 {
    font-size: 14px;
    color: #ff9d43;
}

h3 {
    font-size: 12px;
    color: #64d9ff;
    letter-spacing: 1px;
}

.intro {
    margin: 0;

    color: #a9c1cc;
    font-size: 12px;
    line-height: 1.55;
}

#sidebar label {
    display: block;

    margin: 9px 0;

    font-size: 12px;
    color: #c9dce4;
}

#sidebar input[type="checkbox"],
#sidebar input[type="radio"] {
    margin-right: 8px;
}

#search {
    width: 100%;

    padding: 10px;

    background: #0d2632;
    color: white;

    border:
        1px solid #305668;

    border-radius: 5px;

    outline: none;
}

#search:focus {
    border-color: #ff9d43;
}

#search-results {
    margin-top: 8px;
}

.search-result {
    padding: 8px;

    margin-top: 5px;

    background: #0d2029;

    border:
        1px solid #27414c;

    border-radius: 4px;

    font-size: 11px;

    cursor: pointer;
}

.search-result:hover {
    border-color: #ff9d43;
}

.counts div {
    display: flex;
    justify-content: space-between;

    padding: 5px 0;

    font-size: 12px;
}

.counts strong {
    color: #ffb25c;
}

.notice {
    color: #839da8;
    font-size: 10px;
    line-height: 1.45;
}

.notice strong {
    color: #ff9d43;
}

#map-wrap {
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;

    background: #020406;
}

.leaflet-container {
    background: #020406;
}

#legend {
    position: absolute;

    right: 14px;
    bottom: 20px;

    z-index: 700;

    width: 190px;

    padding: 10px;

    background:
        rgba(
            4,
            14,
            20,
            .90
        );

    border:
        1px solid #49616a;

    border-radius: 5px;

    font-size: 10px;
}

.gradient {
    height: 12px;

    margin-top: 7px;

    background:
        linear-gradient(
            90deg,
            #2f00ff,
            #006cff,
            #00ffff,
            #ffff00,
            #ff6500,
            #ff0000
        );
}

.legend-scale {
    display: flex;
    justify-content: space-between;

    margin-top: 4px;

    color: #afc3cb;
}

#status {
    position: absolute;

    left: 14px;
    bottom: 15px;

    z-index: 700;

    padding: 7px 10px;

    background:
        rgba(
            4,
            14,
            20,
            .86
        );

    border:
        1px solid #314c57;

    border-radius: 4px;

    color: #b7ccd5;

    font-size: 11px;
}

#drawer {
    position: absolute;

    top: 72px;
    right: 0;
    bottom: 0;

    z-index: 900;

    width: 390px;

    transform:
        translateX(100%);

    transition:
        transform .2s ease;

    overflow-y: auto;

    background:
        rgba(
            4,
            15,
            22,
            .98
        );

    border-left:
        1px solid #4a616b;
}

#drawer.open {
    transform:
        translateX(0);
}

#drawer-close {
    position: absolute;

    top: 10px;
    right: 12px;

    width: 34px;
    height: 34px;

    border: 0;

    border-radius: 4px;

    color: white;
    background: #422018;

    font-size: 25px;

    cursor: pointer;
}

#drawer-content {
    padding: 55px 20px 30px 20px;
}

.drawer-title {
    color: #ffad58;

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

.drawer-grid {
    margin-top: 18px;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;
}

.drawer-field {
    padding: 10px;

    background: #0c2029;

    border:
        1px solid #263f4a;

    border-radius: 4px;
}

.drawer-field span {
    display: block;

    margin-bottom: 4px;

    color: #7996a2;

    font-size: 9px;

    text-transform: uppercase;
}

.drawer-field strong {
    font-size: 12px;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;

    gap: 5px;

    margin-top: 13px;
}

.badge {
    padding: 5px 7px;

    border-radius: 3px;

    background: #263139;

    color: #d9e6eb;

    font-size: 10px;
}

.badge.hot {
    background: #6b2416;
    color: #ffd0a6;
}

.well-dot {
    border:
        1px solid rgba(
            255,
            255,
            255,
            .75
        );

    border-radius: 50%;

    background: #ff632c;
}

@media (
    max-width: 900px
) {

    #workspace {
        grid-template-columns:
            230px 1fr;
    }

    .top-stats {
        display: none;
    }

    #drawer {
        width: 330px;
    }
}



/* ============================================================
   GEOTHERMAL ENERGY FOR AI DATA CENTERS - FEATURED BOOK
   ============================================================ */

.geo-book-panel {
    margin: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 138, 40, 0.55);
    border-radius: 8px;

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(255, 89, 0, 0.18),
            transparent 45%
        ),
        linear-gradient(
            145deg,
            rgba(20, 25, 29, 0.98),
            rgba(7, 13, 17, 0.98)
        );

    box-shadow:
        0 0 18px rgba(255, 91, 0, 0.08),
        inset 0 0 20px rgba(255, 120, 0, 0.025);

    color: #d9e8ef;
}

.geo-book-heading {
    display: flex;
    gap: 9px;
    align-items: center;

    padding-bottom: 10px;
    margin-bottom: 11px;

    border-bottom: 1px solid rgba(255,255,255,0.09);
}

.geo-book-icon {
    font-size: 24px;
}

.geo-book-label {
    color: #ff9a32;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.geo-book-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    margin-top: 2px;
}

.geo-book-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.geo-book-cover-wrap {
    position: relative;
    flex: 0 0 92px;
    min-height: 135px;

    border: 1px solid rgba(255, 140, 55, 0.4);
    border-radius: 4px;

    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 75%,
            #ff6a00,
            #5e210d 35%,
            #101820 68%
        );
}

.geo-book-cover {
    display: block;
    width: 100%;
    height: auto;
}

.geo-book-cover-placeholder {
    position: absolute;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 10px;

    color: white;
    text-align: center;

    font-size: 11px;
    font-weight: 900;
    line-height: 1.3;
}

.geo-book-cover-placeholder span {
    color: #ffb04b;
    font-size: 9px;
}

.geo-book-cover-wrap.missing-cover
.geo-book-cover-placeholder {
    display: flex;
    flex-direction: column;
}

.geo-book-copy {
    min-width: 0;
    flex: 1;
}

.geo-book-subtitle {
    color: #ffae51;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;

    margin-bottom: 8px;
}

.geo-book-copy p {
    color: #b9ccd5;
    font-size: 10px;
    line-height: 1.45;
    margin: 0 0 8px 0;
}

.geo-book-copy .geo-book-map-note {
    color: #8fa8b4;
}

.geo-book-amazon {
    display: inline-block;

    margin-top: 3px;
    padding: 8px 10px;

    border: 1px solid #ff8a27;
    border-radius: 4px;

    background:
        linear-gradient(
            180deg,
            #ff9b36,
            #d85d00
        );

    color: #071016 !important;

    text-decoration: none !important;

    font-size: 10px;
    font-weight: 900;
    letter-spacing: .3px;

    box-shadow:
        0 0 12px rgba(255, 112, 0, 0.22);
}

.geo-book-amazon:hover {
    filter: brightness(1.13);
    transform: translateY(-1px);
}


/* If sidebar is narrow, stack book cover and text cleanly */

@media (max-width: 900px) {

    .geo-book-body {
        flex-direction: column;
    }

    .geo-book-cover-wrap {
        width: 115px;
        flex-basis: auto;
    }

}

/* GEOTHERMAL_MOBILE_MAPFIRST_BEGIN */

/*
 * Geothermal phone layout.
 * Desktop remains unchanged.
 */

@media (max-width: 700px) {

    html,
    body {
        width: 100%;
        max-width: 100%;

        height: auto !important;
        min-height: 100%;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }


    /*
     * PAGE ORDER:
     *
     * 1. Header
     * 2. Map
     * 3. Sidebar / search / controls / book
     */

    body {
        display: flex !important;
        flex-direction: column !important;
    }


    /* ======================================================
       HEADER
       ====================================================== */

    header {
        order: 1 !important;

        width: 100%;
        height: auto !important;
        min-height: 0 !important;

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

        gap: 5px !important;

        padding:
            calc(6px + env(safe-area-inset-top))
            9px
            6px !important;
    }

    header > * {
        min-width: 0;
    }

    .logo {
        font-size: 17px !important;
        line-height: 1.1 !important;
    }

    header .subtitle,
    header p {
        margin: 0 !important;

        font-size: 8px !important;
        line-height: 1.2 !important;
    }


    /* ======================================================
       TOP STATISTICS
       ====================================================== */

    .top-stats {
        width: 100% !important;

        display: grid !important;
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 4px !important;

        margin: 2px 0 0 !important;
    }

    .top-stats > * {
        min-width: 0 !important;

        padding: 4px 6px !important;

        font-size: 8px !important;
        line-height: 1.15 !important;

        overflow-wrap: anywhere;
    }

    .top-stats strong {
        font-size: 13px !important;
        line-height: 1.1 !important;
    }


    /* ======================================================
       MAP FIRST
       ====================================================== */

    #map-wrap {
        order: 2 !important;

        position: relative !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: 100% !important;

        height: 72dvh !important;
        min-height: 470px !important;
        max-height: none !important;

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

        overflow: hidden !important;
    }

    #map {
        position: absolute !important;

        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

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

        min-height: 0 !important;

        margin: 0 !important;
    }


    /* ======================================================
       SIDEBAR BELOW MAP
       ====================================================== */

    #sidebar {
        order: 3 !important;

        position: relative !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: 100% !important;
        max-width: none !important;

        height: auto !important;
        max-height: none !important;

        margin: 0 !important;

        overflow: visible !important;

        border-right: none !important;
        border-top: 1px solid rgba(255,255,255,0.12);
    }

    #sidebar section {
        padding: 13px 12px !important;
    }

    #sidebar h2 {
        font-size: 17px !important;
        line-height: 1.25 !important;
    }

    #sidebar h3 {
        font-size: 11px !important;
        line-height: 1.25 !important;
    }


    /* ======================================================
       SEARCH
       ====================================================== */

    #search {
        width: 100% !important;

        min-height: 46px !important;

        padding: 10px 11px !important;

        font-size: 16px !important;
    }

    #search-results {
        width: 100% !important;

        max-height: 260px !important;

        overflow-y: auto !important;

        -webkit-overflow-scrolling: touch;
    }

    .search-result {
        min-height: 44px !important;

        padding: 10px 8px !important;

        font-size: 12px !important;
        line-height: 1.35 !important;

        touch-action: manipulation;
    }


    /* ======================================================
       WELL FILTERS / MAP LAYERS
       ====================================================== */

    #sidebar label {
        min-height: 42px !important;

        display: flex !important;
        align-items: center !important;

        margin: 2px 0 !important;

        font-size: 12px !important;
        line-height: 1.3 !important;

        touch-action: manipulation;
    }

    #sidebar input[type="checkbox"],
    #sidebar input[type="radio"] {
        flex: 0 0 auto;

        width: 21px !important;
        height: 21px !important;

        margin-right: 8px !important;
    }

    #sidebar button,
    #sidebar select {
        min-height: 44px !important;

        max-width: 100%;

        touch-action: manipulation;
    }

    #sidebar select {
        font-size: 16px !important;
    }


    /* ======================================================
       DO NOT COVER PHONE MAP WITH LARGE LEGEND
       ====================================================== */

    #legend {
        display: none !important;
    }


    /* ======================================================
       LEAFLET CONTROLS
       ====================================================== */

    .leaflet-top {
        top: 5px !important;
    }

    .leaflet-left {
        left: 5px !important;
    }

    .leaflet-right {
        right: 5px !important;
    }

    .leaflet-bottom {
        bottom: 5px !important;
    }

    .leaflet-control {
        margin: 5px !important;
    }

    .leaflet-control-zoom a {
        width: 40px !important;
        height: 40px !important;

        line-height: 40px !important;

        font-size: 20px !important;
    }

    .leaflet-control-layers {
        max-width: calc(100vw - 60px) !important;

        font-size: 11px !important;
    }

    .leaflet-control-layers-expanded {
        max-width: calc(100vw - 30px) !important;
        max-height: 50dvh !important;

        overflow-y: auto !important;

        padding: 9px !important;

        -webkit-overflow-scrolling: touch;
    }

    .leaflet-control-layers label {
        min-height: 34px !important;

        display: flex !important;
        align-items: center !important;
    }

    .leaflet-control-layers input {
        width: 18px !important;
        height: 18px !important;

        margin-right: 7px !important;
    }

    .leaflet-control-attribution {
        max-width: 70vw !important;

        padding: 1px 4px !important;

        font-size: 7px !important;
        line-height: 1.15 !important;

        white-space: normal !important;
    }


    /* ======================================================
       LEAFLET POPUPS
       ====================================================== */

    .leaflet-popup {
        max-width: calc(100vw - 40px) !important;
    }

    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 40px) !important;
    }

    .leaflet-popup-content {
        width: auto !important;
        max-width: calc(100vw - 76px) !important;

        margin: 12px 14px !important;

        font-size: 11px !important;
        line-height: 1.4 !important;

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


    /* ======================================================
       WELL DETAIL DRAWER
       CLOSED = COMPLETELY OFF THE MAP
       OPEN = FULL PHONE SCREEN
       ====================================================== */

    #drawer {
        position: fixed !important;

        top: 0 !important;
        right: -105vw !important;
        bottom: 0 !important;
        left: auto !important;

        width: 100vw !important;
        max-width: none !important;

        height: 100dvh !important;
        max-height: none !important;

        z-index: 10000 !important;

        visibility: hidden !important;
        pointer-events: none !important;

        overflow: hidden !important;
    }

    #drawer.open {
        right: 0 !important;

        width: 100vw !important;

        visibility: visible !important;
        pointer-events: auto !important;
    }

    #drawer-content {
        width: 100% !important;
        height: 100% !important;

        max-width: none !important;
        max-height: none !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        padding:
            calc(58px + env(safe-area-inset-top))
            14px
            calc(24px + env(safe-area-inset-bottom))
            !important;

        -webkit-overflow-scrolling: touch;

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

    #drawer-close {
        position: fixed !important;

        top: calc(8px + env(safe-area-inset-top)) !important;
        right: 10px !important;

        z-index: 10001 !important;

        width: 46px !important;
        height: 46px !important;

        min-width: 46px !important;
        min-height: 46px !important;

        padding: 0 !important;

        font-size: 28px !important;
        line-height: 42px !important;

        touch-action: manipulation;
    }

    .drawer-title {
        font-size: 20px !important;
        line-height: 1.2 !important;
    }

    .drawer-grid {
        grid-template-columns: 1fr !important;
    }

    .drawer-field {
        min-width: 0 !important;
    }

    .drawer-field strong,
    .drawer-field span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }


    /* ======================================================
       FEATURED GEOTHERMAL BOOK
       BELOW MAP, COMPACT ON PHONE
       ====================================================== */

    .geo-book-panel {
        width: 100% !important;

        margin: 0 !important;

        padding: 12px !important;
    }

    .geo-book-body {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;

        gap: 11px !important;
    }

    .geo-book-cover-wrap {
        flex: 0 0 82px !important;

        width: 82px !important;
        max-width: 82px !important;
    }

    .geo-book-cover-wrap img {
        display: block;

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

    .geo-book-copy {
        flex: 1 1 auto !important;

        min-width: 0 !important;
    }

    .geo-book-copy h2,
    .geo-book-copy h3 {
        font-size: 14px !important;
        line-height: 1.25 !important;
    }

    .geo-book-copy p {
        font-size: 11px !important;
        line-height: 1.4 !important;

        overflow-wrap: anywhere;
    }

    .geo-book-copy .geo-book-map-note {
        font-size: 10px !important;
    }

}


/* ==========================================================
   SMALL PHONES
   ========================================================== */

@media (max-width: 430px) {

    #map-wrap {
        height: 74dvh !important;
        min-height: 450px !important;
    }

    .top-stats strong {
        font-size: 12px !important;
    }

    .geo-book-cover-wrap {
        flex-basis: 72px !important;

        width: 72px !important;
        max-width: 72px !important;
    }

}


/* ==========================================================
   LANDSCAPE PHONE
   ========================================================== */

@media
    (max-width: 900px)
    and (orientation: landscape)
    and (max-height: 520px) {

    header {
        padding-top: 3px !important;
        padding-bottom: 3px !important;
    }

    .top-stats {
        grid-template-columns:
            repeat(4, minmax(0, 1fr)) !important;
    }

    #map-wrap {
        height: 84dvh !important;
        min-height: 300px !important;
    }

}

/* GEOTHERMAL_MOBILE_MAPFIRST_END */

/* GEOTHERMAL_PHONE_SIDEBAR_FIX_BEGIN */

@media (max-width: 700px) {

    /*
     * PHONE:
     * sidebar is NOT part of the normal page layout.
     * It becomes a slide-up control panel.
     */

    #sidebar {
        position: fixed !important;

        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        width: 100vw !important;
        max-width: 100vw !important;

        height: auto !important;
        max-height: 72dvh !important;

        margin: 0 !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        z-index: 9500 !important;

        transform: translateY(105%) !important;

        transition:
            transform 0.22s ease !important;

        visibility: hidden !important;
        pointer-events: none !important;

        border: 1px solid rgba(90, 180, 210, 0.4) !important;
        border-bottom: none !important;

        border-radius: 14px 14px 0 0 !important;

        box-shadow:
            0 -8px 30px rgba(0,0,0,0.65) !important;

        -webkit-overflow-scrolling: touch;
    }


    #sidebar.geo-mobile-open {
        transform: translateY(0) !important;

        visibility: visible !important;
        pointer-events: auto !important;
    }


    /*
     * MAP GETS THE SCREEN
     */

    #map-wrap {
        width: 100vw !important;

        height: 82dvh !important;
        min-height: 520px !important;

        margin: 0 !important;

        position: relative !important;

        left: auto !important;
        right: auto !important;
    }


    #map {
        width: 100% !important;
        height: 100% !important;
    }


    /*
     * CONTROLS BUTTON
     */

    #geo-mobile-controls {
        position: absolute !important;

        z-index: 8500 !important;

        right: 10px !important;
        bottom: 18px !important;

        min-width: 108px !important;
        min-height: 44px !important;

        padding: 8px 13px !important;

        border: 1px solid rgba(72, 190, 220, 0.8) !important;
        border-radius: 22px !important;

        background: rgba(5, 24, 32, 0.94) !important;

        color: #eaffff !important;

        font-size: 11px !important;
        font-weight: 700 !important;

        letter-spacing: 0.08em !important;

        cursor: pointer !important;

        box-shadow:
            0 3px 15px rgba(0,0,0,0.55) !important;

        touch-action: manipulation;
    }


    #geo-mobile-controls.geo-open {
        position: fixed !important;

        top: auto !important;
        right: 12px !important;
        bottom: calc(72dvh - 52px) !important;

        z-index: 9600 !important;
    }


    /*
     * Make sidebar controls easy to use.
     */

    #sidebar section {
        padding: 12px !important;
    }


    #sidebar input,
    #sidebar select,
    #sidebar button {
        max-width: 100% !important;
    }


    #sidebar label {
        min-height: 42px !important;
    }


    /*
     * Keep the book below everything;
     * don't make it part of the visible map area.
     */

    .geo-book-panel {
        max-width: 100% !important;
    }


    /*
     * WELL DETAIL DRAWER REMAINS ABOVE CONTROL PANEL.
     */

    #drawer {
        z-index: 11000 !important;
    }


    #drawer-close {
        z-index: 11001 !important;
    }

}


@media (max-width: 430px) {

    #map-wrap {
        height: 84dvh !important;
        min-height: 500px !important;
    }

}


@media
    (max-width: 900px)
    and (orientation: landscape)
    and (max-height: 520px) {

    #map-wrap {
        height: 88dvh !important;
        min-height: 300px !important;
    }

    #sidebar {
        max-height: 82dvh !important;
    }

}

/* GEOTHERMAL_PHONE_SIDEBAR_FIX_END */
