:root {
    /* Warm, sunny background (Stone-50) */
    --bg: #FAFAF9;
    --panel-bg: #ffffff;
    /* Warmer border (Stone-200) */
    --border: #E7E5E4;
    /* Softer, warmer text (Stone-900) */
    --text: #1C1917;
    --text-muted: #57534E;
    /* Solar Green Accent */
    --accent: #15803D;
    --accent-hover: #14532D;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    height: 100vh;
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

#app {
    display: grid;
    grid-template-columns: 480px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Leaflet map container */
#map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    margin: 12px 0;
    border: 1px solid var(--border);
    z-index: 1;
}

/* Make leaflet controls match your design */
.leaflet-control-geocoder {
    border-radius: 8px !important;
}

.leaflet-bar {
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
}

/* Location button styling */
#use-current-location {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
}

#use-current-location:hover {
    background: var(--accent-hover);
}

.coordinates-display {
    padding: 10px 12px;
    background: #F3F4F6;
    border-radius: 6px;
    font-weight: 600;
    color: var(--accent-hover);
    text-align: center;
}

/* Hamburger menu button */
#menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

#menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text);
    margin: 5px 0;
    transition: 0.3s;
}

#mobile-header {
    display: none;
}

/* Sidebar */
#sidebar {
    /* Glassmorphism background */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */

    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    /* Softer border */
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 8px;
    /* Scrollbar space */
}

.sidebar-header {
    margin: 0;
    padding-left: 4px;
    font-size: 1.8rem;
    color: var(--text);
}

.mobile-text {
    display: none;
}

.header {
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
}

h1 {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 700;
    color: black;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.subtitle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;

    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;

    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);

    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.share-btn:hover {
    background: #ffffff;
    color: var(--accent);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-btn svg {
    width: 14px;
    height: 14px;
}

.section {
    background: var(--panel-bg);
    /* Remove border, use shadow for definition */
    border: none;
    border-radius: 12px;
    /* Increased radius */
    padding: 20px;
    /* More breathing room */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
    /* Ensure spacing between cards */
}

.section h2 {
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    letter-spacing: normal;
}

.section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    margin-top: 4px;
}

.field {
    margin-bottom: 16px;
}

.field:last-child {
    margin-bottom: 0;
}

label,
.field>span {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

input[type="number"],
input[type="date"],
select {
    width: 100%;
    /* Full width looks better in cards */
    padding: 10px 12px;
    border: 1px solid transparent;
    /* No visible border by default */
    background-color: #F3F4F6;
    /* Light gray fill */
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
    /* Ensure they use Inter */
}

select {
    background: #F3F4F6;
    /* Pale blue background */
    border: 1.5px solid var(--accent);
    /* Blue border */
    color: var(--accent-hover);
    /* Darker blue text */
    border-radius: 6px;
    font-size: 1rem;
    padding: 10px 38px 10px 12px;
    /* Room for arrow on right */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
    background: #d6eaff;
}

select:disabled {
    background: #f0f2f5;
    color: #a0aec0;
    border-color: #e0e3e8;
}

input[type="date"] {
    background: #F3F4F6;
    border: 1.5px solid var(--accent);
    color: var(--accent-hover);
    border-radius: 6px;
    font-size: 1rem;
    padding: 10px 12px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border 0.2s, box-shadow 0.2s;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
    background: #d6eaff;
}

input[type="date"]:disabled {
    background: #f0f2f5;
    color: #a0aec0;
    border-color: #e0e3e8;
}

/* Optional: Remove the default calendar icon on Chrome/Safari/Edge and add your own */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(35%) sepia(85%) saturate(1200%) hue-rotate(95deg) brightness(95%) contrast(90%);
    /* This makes the icon green-ish, but can't fully replace it */
}

input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    /* Taller track */
    border-radius: 4px;
    background: #E5E7EB;
    /* Lighter gray track */
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid #ffffff;
    /* White ring for contrast */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.input-with-unit {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit .unit {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
}

.value-display {
    color: var(--accent);
    font-weight: 600;
}

.status {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid var(--accent);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status.error {
    border-left-color: #ef4444;
    color: #dc2626;
}

.status.success {
    border-left-color: #10b981;
    color: #059669;
}

/* Main area */
#main {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
}

#scene-container {
    flex: 0 0 60vh;
    position: relative;
    /* Beautiful sky gradient: Pale Blue -> White */
    background: linear-gradient(to bottom, #E0F2FE 0%, #F0F9FF 60%, #FAFAF9 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-height: 400px;
}

#scene-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}



/* Info Panel (Bottom Area) */
#info-panel {
    z-index: 10;
    margin-top: 16px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding-bottom: 40px;
    background: transparent;
    /* Explicitly transparent */
    box-shadow: none;
    border: none;
}

#shadow-info {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    z-index: 1;

    padding: 24px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);

    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centered items */
    /* gap: 16px; REMOVED for manual control */

    text-align: center;
    /* Centered text */
    min-width: 320px;
    max-width: 100%;
    flex: 1;
}

#shadow-info h3 {
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
}

#shadow-info .value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: 4px;
}

.overlay-details {
    display: flex;
    flex-direction: column;
    /* Stack them for better centering */
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.overlay-formula {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Custom Tooltip Styles */
[data-tooltip] {
    position: relative;
    cursor: help;
    text-decoration: underline dotted;
    text-decoration-color: var(--accent);
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1F2937;
    color: white;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 200px;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    line-height: 1.4;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 500;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1F2937 transparent transparent transparent;
    margin-bottom: -4px;
    z-index: 100;
}

.overlay-formula .calc-line {
    display: inline;
}

.overlay-formula .calc-result {
    display: inline;
    font-weight: 600;
    color: var(--accent);
}

.overlay-azimuth {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.context-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
    /* Push to bottom */
    width: 100%;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* Triangle diagram */
#triangle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 320px;
}


#triangle-container h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text);
}

#triangle-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.triangle-path {
    stroke: var(--text);
    stroke-width: 2.5;
    fill: none;
    stroke-linejoin: round;
}

.triangle-fill {
    fill: rgba(59, 130, 246, 0.08);
}

.triangle-angle-arc {
    stroke: var(--accent);
    stroke-width: 2;
    fill: none;
}

.triangle-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    fill: var(--text);
    font-weight: 500;
}

.triangle-value {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    fill: var(--accent);
    font-weight: 600;
}

#math-details {
    margin-top: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-muted);
    display: none;
}

#math-details.visible {
    display: block;
}

/* Intro Text */
.intro-text {
    display: none;
    /* Moved to math section */
}

/* Advanced SEO & Math Intro */
.intro-math-section {
    margin-bottom: 12px;
}

.seo-text {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.formula-box {
    background: #F3F4F6;
    /* Light gray background matching inputs */
    color: var(--text);
    padding: 16px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    box-shadow: none;
}

.main-formula {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text);
    font-family: "SF Mono", Menlo, Consolas, monospace;
}

.var {
    color: var(--accent);
    font-weight: 700;
}

.formula-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 12px;
}

/* Result Section (Calculator Feel) */
.result-section {
    border-left: 4px solid var(--accent);
    /* Highlight this box */
    background: white;
}

/* Live Formula Display */
.live-formula {
    background: #F3F4F6;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.calc-line {
    display: block;
    margin-bottom: 4px;
}

.var-val {
    color: var(--text);
    font-weight: 600;
}

.calc-result {
    display: block;
    color: var(--accent);
    /* Solar Green */
    font-weight: 700;
    font-size: 1.1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}

.result-item {
    display: flex;
    flex-direction: column;
    background: #F3F4F6;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.result-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.result-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
}

/* Triangle Diagram Improvements */
#triangle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

#triangle-container h3 {
    align-self: flex-start;
    /* Align title to left */
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

#triangle-container.hidden {
    display: none;
}

/* Mobile */
/* Mobile Experience Upgrade */
@media (max-width: 768px) {
    #app {
        grid-template-columns: 1fr;
    }

    /* Floating Action Button (FAB) */
    #menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;

        position: fixed;
        top: auto;
        left: auto;
        bottom: 24px;
        right: 24px;
        z-index: 1002;

        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: var(--accent);
        border: none;
        box-shadow: 0 4px 15px rgba(21, 128, 61, 0.4);
        padding: 0;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    #menu-toggle:active {
        transform: scale(0.9);
    }

    /* White icon lines inside FAB */
    #menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #ffffff;
        margin: 0;
        transition: 0.3s;
        position: relative;
    }

    #menu-toggle.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    #menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    #menu-toggle.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Mobile Header Bar */
    #mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 6px 12px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 998;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    #mobile-header h1,
    #mobile-header .brand-title {
        font-family: 'Inter', sans-serif;
        font-size: 1.1rem;
        font-weight: 700;
        margin: 0;
        color: black;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
    }

    #mobile-header a {
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Bottom Sheet Sidebar */
    #sidebar {
        position: fixed;
        left: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        /* Covers 85% of screen */

        background: #ffffff;
        border-radius: 24px 24px 0 0;
        /* Rounded top corners */
        transform: translateY(100%);
        /* Hidden by default */
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        /* Smooth slide */
        /* Smooth slide */
        z-index: 1001;
        padding: 32px 24px;

        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        border-right: none;
    }

    #sidebar.open {
        transform: translateY(0);
    }

    /* #shadow-info rule removed to fix mobile layout compliance */


    /* Header is redundant in sidebar on mobile now that share button is moved */
    #sidebar .header {
        display: none;
    }

    #main {
        padding: 8px 12px 100px 12px;
        /* Extra bottom padding for FAB space */
        height: 100vh;
        overflow-y: auto;
    }

    #sidebar {
        gap: 4px;
    }

    #mobile-location-container {
        gap: 4px !important;
        margin: 8px !important;
    }

    .section {
        margin-bottom: 4px !important;
        padding: 16px !important;
    }

    #main .section:last-child {
        margin-bottom: 0;
    }

    #scene-container {
        min-height: 200px;
        flex: 0 0 35vh;
        margin-bottom: 8px;
    }

    #triangle-container {
        padding: 12px;
        align-items: center !important;
        text-align: center !important;
    }

    #triangle-container #triangle-svg {
        width: auto;
        max-width: 100%;
        max-height: 200px;
    }

    #info-panel {
        margin-top: 8px;
        gap: 12px;
        padding-bottom: 20px;
        flex-direction: column;
        align-items: stretch;
    }

    #info-panel>div {
        width: 100%;
        max-width: none;
        flex: auto;
    }

    .desktop-text {
        display: none;
    }

    .mobile-text {
        display: inline;
    }

    /* Compact inputs for mobile */
    .compact-mobile {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .compact-mobile h3 {
        margin: 0;
        white-space: nowrap;
        /* prevent wrapping */
    }

    .compact-mobile select,
    .compact-mobile input {
        width: 100%;
        max-width: 65%;
        margin-top: 0;
    }
}

@media (max-width: 480px) {

    h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .section {
        padding: 12px !important;
    }

    #sidebar {
        gap: 4px;
    }

    #mobile-location-container {
        gap: 4px !important;
        margin: 4px !important;
    }

    #main {
        padding: 8px 8px 8px 8px;
        gap: 4px;
        overflow-y: auto;
        overflow-x: hidden;
        height: 100vh;
    }

    #scene-container {
        min-height: 180px;
        flex: 0 0 32vh;
        margin-bottom: 4px;
    }

    label {
        font-size: 0.8rem;
    }

    input[type="number"],
    input[type="date"],
    select {
        padding: 10px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    #info-panel {
        margin-top: 4px;
        gap: 8px;
        padding-bottom: 12px;
        flex-direction: column;
    }

    .section {
        margin-bottom: 4px !important;
    }
}

#rotate-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    /* Bouncy spring */
    color: var(--text-muted);
    z-index: 1000;
}

#rotate-btn:hover {
    background: white;
    color: var(--accent);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

#rotate-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#rotate-btn:hover svg {
    transform: rotate(90deg);
}

/* Mobile specific styles */
@media (max-width: 768px) {
    #mobile-shadow-summary {
        display: block !important;
    }

    #shadow-info,
    #triangle-container {
        position: relative !important;
        z-index: 0 !important;
        min-width: unset !important;
        width: 100% !important;
        order: 99 !important;

        /* Match .section styles exactly on mobile */
        padding: 12px !important;
        margin-bottom: 6px !important;
        border: none !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
        border-radius: 12px !important;
        background: var(--panel-bg) !important;

        /* Reset flex alignment to default block-like behavior */
        align-items: stretch !important;
        text-align: left !important;
    }

    #triangle-svg {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
    }

    #mobile-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 6px 12px !important;
        width: 100% !important;
        background: #fff !important;
        position: relative !important;
        z-index: 10 !important;
        margin-bottom: 0 !important;
        border-bottom: 1px solid var(--border) !important;
    }
}

@media (min-width: 769px) {
    #mobile-shadow-summary {
        display: none !important;
    }

    /* Hide the mobile container wrapper explicitly on desktop so it takes 0 space */
    #mobile-location-container {
        display: none !important;
    }
}