/* --- Jost Font Declarations --- */
/* Paths are relative to the location of style.css (which is in /static/) */

/* Jost Hairline (Weight 100) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-100-Hairline.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

/* Jost Thin (Weight 200) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-200-Thin.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

/* Jost Light (Weight 300) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-300-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Jost Book (Weight 400 - often considered 'Regular') */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-400-Book.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Jost Medium (Weight 500) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-500-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Jost SemiBold (Weight 600) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-600-Semi.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Jost Bold (Weight 700) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-700-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Jost Heavy (Weight 800) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-800-Heavy.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Jost Black (Weight 900) */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-900-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Jost Black Italic (Weight 900, Italic) - for .otf file */
@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-900-Blackitalic.otf') format('opentype');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

/* --- END Jost Font Declarations --- */


:root {
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-primary: #007bff;
    --accent-secondary: #28a745;
    --border-color: #dee2e6;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);

    /* NEW: Variables for input background/border in settings */
    --input-bg: #f8f9fa;
    --input-border: #ced4da;
    --hover-bg: #e2e6ea; /* General hover background for buttons/icons */
}

/* Dark Mode Styles */
body.dark-mode {
    --background-color: #1a1a1a;
    --card-background: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --accent-primary: #6ab04c; /* A softer green for dark mode */
    --accent-secondary: #00bcd4; /* A teal for secondary accent */
    --border-color: #3a3a3a;
    --shadow: 0 4px 12px rgba(0,0,0,0.5);

    /* NEW: Dark mode specific input background/border in settings */
    --input-bg: #343a40;
    --input-border: #495057;
    --hover-bg: #3f444a;
}

body {
    margin: 0;
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Make body fill the viewport height */
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for dark mode */
}

/* NEW: Page Header */
.page-header {
    flex-shrink: 0; /* Prevent header from shrinking */
    padding: 20px 25px 15px 25px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-background);
}

.page-header h1 {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.page-header .tagline {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin: 0;
}


#main-container {
    display: flex;
    flex-grow: 1; /* Allow main container to fill remaining space */
    min-height: 0; /* Crucial for preventing flexbox overflow */
    width: 100%;
    padding: 25px;
    box-sizing: border-box;
    gap: 25px;
}

/* NEW: Wrapper for the map column */
#map-column {
    flex: 1; /* Occupy 1/3 of the space */
    display: flex;
    flex-direction: column;
    gap: 25px; /* Space between map and lower panel */
    min-width: 0;
}

#map {
    flex: 1; /* Occupy top half of the column */
    min-height: 0; /* Important for flex children */
    position: relative;
    transition: filter 0.3s ease, box-shadow 0.3s ease;

    /* Card-like styles */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden; /* This is crucial to clip the map corners */
}

/* NEW: Style for the empty panel that will hold the 3D model */
#map-lower-panel {
    flex: 1; /* Occupy bottom half of the column */
    min-height: 0; /* Important for flex children */
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    box-sizing: border-box;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    /* Flex column layout for title + canvas */
    display: flex;
    flex-direction: column;
}
#map-lower-panel h4 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.canvas-container {
    flex-grow: 1;
    min-height: 0;
    position: relative; /* Needed for renderer to size correctly */
}

body.dark-mode #map {
    /* Simple filter to make satellite imagery appear darker/desaturated */
    filter: invert(0.9) hue-rotate(180deg) brightness(0.9);
}

#data-panel, #ai-panel {
    flex: 1; /* Occupy 1/3 of the space */
    min-width: 0;
    height: 100%;
    display: flex; /* Make panels flex columns to contain cards */
    flex-direction: column;
}

#ai-panel > .card,
#data-panel > #calculator-container {
    flex-grow: 1; /* Allow cards to fill the panel height */
    display: flex;
    flex-direction: column;
    margin-bottom: 0; /* Remove margin as it's the only element */
}

#data-panel > #calculator-container {
    gap: 25px; /* Add space between explorer and assumptions cards */
    overflow-y: auto; /* Allow calculator section itself to scroll if needed */
}

#calculator-container.hidden, .hidden {
    display: none;
}
.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Lucide icons are SVGs, so target the svg element */
h4 svg,
.control-group label svg,
.input-group-title svg,
.item-label svg,
#chat-send svg,
.global-control-button svg,
.tagline svg {
    stroke: currentColor;
    fill: none;
    width: 1em; /* Make them match font size */
    height: 1em;
    vertical-align: middle;
    margin-right: 5px;
}
.global-control-button svg{
    width: 18px;
    height: 18px;
    margin-right: 8px;
}


.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-primary);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default */
}
.spinner.active {
    display: inline-block;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

h4 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0; /* Reset margin */
    padding: 0; /* Reset padding */
    border: none; /* Reset border */
    flex-shrink: 0;
}

#explorer-card > h4, .cost-group > h4 {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

#explorer-card .key-metrics {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    background-color: var(--card-background);
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.metric .label {
    color: var(--text-secondary);
    font-size: 1em;
    margin-bottom: 5px;
}
.metric .value {
    font-size: 2em;
    font-weight: 700;
}
.metric .value.profit { color: var(--accent-secondary); }
.metric .value.cost { color: var(--text-primary); }
.metric .value.payback { color: var(--accent-primary); }
#controls { padding: 15px 0; border-top: 1px solid var(--border-color); }
.control-group { margin-bottom: 20px; }
.control-group label {
    display: flex; /* Use flex to align icon */
    align-items: center;
    font-weight: 500;
    margin-bottom: 10px;
    gap: 8px; /* Space between icon and text */
}
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative; /* For tooltip positioning */
}
.slider-container input[type="range"] { flex-grow: 1; cursor: grab; }
.slider-container input[type="range"]:active { cursor: grabbing; }
.slider-container .value-display {
    font-weight: 600;
    font-size: 1.1em;
    width: 100px;
    text-align: right;
}
/* Slider Tooltip */
.slider-tooltip {
    position: absolute;
    background-color: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    bottom: 100%; /* Position above slider */
    left: var(--tooltip-left, 50%); /* Dynamic left position */
    transform: translateX(-50%) translateY(-5px); /* Center and push up */
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 10;
}
.slider-container input[type="range"]:hover + .value-display + .slider-tooltip,
.slider-container input[type="range"]:active + .value-display + .slider-tooltip {
     opacity: 1;
     visibility: visible;
}


.button-group { display: inline-flex; }
.button-group button {
    padding: 8px 16px;
    font-size: 1em;
    border: 1px solid var(--border-color);
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    color: var(--text-secondary); /* Default text color for non-selected buttons */
}
.button-group button:first-child { border-radius: 8px 0 0 8px; margin-right: -1px;}
.button-group button:last-child { border-radius: 0 8px 8px 0; }
.button-group button.selected {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    z-index: 1;
}
.button-group button:hover:not(.selected) {
    background-color: var(--background-color); /* Use background color for subtle hover */
}
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}
.tab-link.active {
    color: var(--text-primary);
    border-bottom: 3px solid var(--accent-primary);
}
.tab-link:hover:not(.active) {
    color: var(--accent-primary);
}
.tab-content {
    display: none;
    padding-top: 15px;
    overflow-y: auto; /* Allow individual tabs to scroll if content is long */
}
.tab-content.active {
    display: block;
}
.input-group-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex; /* Use flex to align icon */
    align-items: center;
    gap: 8px; /* Space between icon and text */
}

/* Cost Grouping */
.cost-group {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
    background-color: var(--background-color); /* Matches background, adjust if needed */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
body.dark-mode .cost-group {
    background-color: #2e2e2e; /* Slightly different background for dark mode groups */
}
.cost-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr auto;
    gap: 15px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color); /* Use var for border */
}
.cost-item:last-child {
    border-bottom: none;
}
.item-label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}
.cost-item .sub-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-left: 8px;
}
.item-input {
    text-align: right;
    color: var(--text-secondary);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap; /* Prevent wrapping */
    gap: 4px;
}
.cost-item .item-total {
    text-align: right;
    font-weight: 600;
    font-size: 1.05em;
    min-width: 70px;
    color: var(--text-primary);
}
.editable-input {
    width: 70px;
    text-align: right;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 1em;
    background-color: var(--card-background); /* Ensure input background changes */
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.editable-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.cost-total-summary {
    font-weight: 700;
    font-size: 1.1em;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}
.cost-total-summary span:last-child {
    color: var(--text-primary);
}

/* NEW: Consistent styling for Generation/Assumption Inputs */
.assumptions-grid {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}
.assumption-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* Give more space to label */
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.assumption-row:last-child {
    border-bottom: none;
}
.unit-prefix, .unit-suffix {
    font-size: 0.95em;
    color: var(--text-secondary);
}
#generation-inputs hr {
    margin: 25px 0 15px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}


.supplier-card {
    display: flex; gap: 20px; padding: 15px; border: 1px solid var(--border-color);
    border-radius: var(--border-radius); margin-bottom: 15px; align-items: center;
    transition: box-shadow 0.2s, transform 0.2s, background-color 0.3s ease, border-color 0.3s ease;
    background-color: var(--card-background);
}
.supplier-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.supplier-logo {
    width: 50px; height: 50px; object-fit: cover; border-radius: 50%;
    background-color: var(--background-color); /* Adjust for dark mode */
    display:flex; align-items:center; justify-content:center; font-size:1.5em; font-weight:bold;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}
body.dark-mode .supplier-logo {
    background-color: #3a3a3a;
    color: #b0b0b0;
}
.supplier-details { flex-grow: 1; }
.supplier-details h5 { margin: 0 0 5px 0; font-size: 1.1em; color: var(--text-primary); }
.supplier-rating { color: var(--text-secondary); font-size: 0.9em; }
.supplier-cta a { text-decoration: none; }
.supplier-cta button {
    padding: 10px 15px; font-size: 1em; cursor: pointer;
    background-color: var(--accent-secondary); color: white;
    border: none; border-radius: 8px; font-weight: 500;
    transition: background-color 0.2s;
}
.supplier-cta button:hover { background-color: var(--accent-secondary); filter: brightness(0.9); }
.supplier-cta button:disabled { background-color: #6c757d; cursor: not-allowed; }

/* AI Panel Styles */
#ai-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
#ai-chat-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow container to fill space in card */
    min-height: 0; /* Fix for flexbox scrolling bugs */
}

.chat-messages {
    flex-grow: 1; padding: 15px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: var(--border-radius); margin-bottom: 15px; display: flex; flex-direction: column; gap: 12px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.chat-message {
    padding: 10px 15px; border-radius: 18px; max-width: 85%; line-height: 1.4;
    word-wrap: break-word; /* Ensure long words don't overflow */
}
.chat-message.user {
    background-color: var(--accent-primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px;
}
.chat-message.bot {
    background-color: var(--card-background); color: var(--text-primary); align-self: flex-start; border-bottom-left-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
body.dark-mode .chat-message.bot {
    background-color: #3a3a3a;
    color: var(--text-primary);
}
.chat-message.thinking span.thinking-dots span { display: inline-block; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.chat-suggestions { padding-bottom: 15px; flex-shrink: 0; }
.chat-suggestions button {
    background: transparent; border: 1px solid var(--accent-primary); color: var(--accent-primary); padding: 5px 10px; margin: 0 5px 5px 0; border-radius: 15px; font-size: 0.9em; cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.chat-suggestions button:hover {
    background-color: var(--accent-primary);
    color: white;
}
.chat-input-form { display: flex; gap: 10px; flex-shrink: 0; }
#chat-input {
    flex-grow: 1; border: 1px solid var(--border-color); border-radius: 18px; padding: 10px 15px; font-size: 1em;
    background-color: var(--card-background);
    color: var(--text-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
#chat-input:disabled {
    background-color: var(--background-color);
    cursor: not-allowed;
}
#chat-send {
    border: none; background: var(--accent-primary); color: white; border-radius: 50%; width: 44px; height: 44px; font-size: 18px; cursor: pointer; flex-shrink: 0;
}

/* --- Global Controls & Settings Menu Styles --- */
#global-controls {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 900;
    display: flex;
    gap: 10px;
}

#settings-area {
    position: relative;
}

.global-control-button {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.9em;
    font-weight: 500;
}

.global-control-button:hover {
    background-color: var(--hover-bg);
    transform: translateY(-1px);
    border-color: var(--accent-primary);
}

/* Settings Dropdown Menu */
#settings-dropdown {
    position: absolute;
    top: calc(100% + 10px); /* Position below the button */
    right: 0; /* Align to the right of the settings area */
    left: auto;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 15px;
    min-width: 220px; /* Adjust as needed */
    z-index: 950; /* Higher than icon area */
    opacity: 0;
    transform: translateY(-10px); /* Start slightly above and faded */
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
    pointer-events: none; /* Allows clicks to pass through when hidden */
}

#settings-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Enable clicks when visible */
}

/* Re-using existing setting-item and switch styles */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--input-border); /* Use input-border for these internal lines */
    color: var(--text-primary);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item span {
    font-size: 0.95em;
    color: var(--text-primary); /* Ensure text color changes with theme */
}

/* Toggle Switch (for dark mode) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--input-border); /* Use border color for track */
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--card-background); /* Slider handle color */
    -webkit-transition: .4s;
    transition: .4s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Small shadow for the handle */
}

input:checked + .slider {
    background-color: var(--accent-primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-primary);
}

input:checked + .slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Select Box Styling */
#currency-selector {
    padding: 5px 8px;
    border-radius: var(--border-radius);
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

#currency-selector:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2); /* Assuming primary-rgb variable for accent */
}


/* Responsive adjustments */
@media (max-width: 1200px) { /* Changed breakpoint to 1200px for stacking */
    body {
        height: auto;
    }
    .page-header {
        padding: 15px;
    }
    #main-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px; /* Reduce gap for stacked layout */
    }
    #map-column, #data-panel, #ai-panel {
        width: 100%;
        height: auto; /* Let content dictate height */
        flex: none; /* Reset flex property for stacked layout */
    }
    #map-column {
        height: 60vh; /* Set a height for the map column */
        min-height: 400px;
    }
    #data-panel, #ai-panel {
        overflow-y: visible; /* Prevent double scrollbars */
    }
    #data-panel > #calculator-container {
        overflow-y: visible;
    }
    #ai-panel {
        max-height: 70vh; /* Give AI panel a max height on mobile */
    }
    .card {
        margin-bottom: 0;
    }
    #explorer-card .key-metrics {
        position: static;
        margin-left: -25px;
        margin-right: -25px;
    }

    #global-controls {
        top: 10px;
        right: 10px;
    }
    #settings-dropdown {
        top: calc(100% + 8px);
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.5em;
    }
    .page-header .tagline {
        font-size: 1em;
    }
    #main-container {
        padding: 10px;
        gap: 10px;
    }
    #map-column {
        height: 50vh; /* Make map column smaller on very small screens */
    }
    .card {
        padding: 15px;
    }
    .metric .value {
        font-size: 1.6em;
    }
    .button-group button {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    .editable-input {
        width: 50px;
        padding: 4px;
    }
    .cost-item, .assumption-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .item-input {
        justify-content: flex-start;
        padding-left: 20px;
    }
    .cost-item .item-total {
       text-align: left;
       padding-left: 20px;
       font-size: 1em;
    }
    .cost-total-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}