:root {
    /* Updated Color Palette for a Snazzier Look */
    --primary-bg: #1A1A2E; /* Dark Blue-Purple */
    --secondary-bg: #16213E; /* Slightly Lighter Dark Blue */
    --accent-color-1: #0F3460; /* Darker Blue for accents */
    --accent-color-2: #E94560; /* Vibrant Red-Pink for buttons/highlights */
    --text-color: #E0E0E0; /* Light Gray for main text */
    --subtle-text-color: #A0A0A0; /* Muted Gray for info text */
    --border-color: #3C4257; /* Darker border for depth */
    --input-bg: #2E3147; /* Input field background */
    --input-text: #E0E0E0; /* Input text color */
    --hover-effect: rgba(255, 255, 255, 0.08); /* Subtle hover effect */

    /* Sticky Note Colors - Updated for new scheme */
    --red-note: #FFDCDC; /* Softer red, light background */
    --yellow-note: #FFFACD; /* Softer yellow, light background */
    --pinned-note: #AEC6CF; /* Soft blue for pinned notes, light background */
    --note-text-color: #333333; /* Dark text on light notes */

    /* Shadows for depth */
    --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 10px; /* Overall app rounded corners */
    overflow: hidden; /* Contains internal elements */
    box-shadow: var(--shadow-strong);
}

/* Navigation Frame */
.nav-frame {
    width: 220px; /* Slightly wider nav */
    background-color: var(--secondary-bg);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--border-color);
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.2); /* Inner shadow */
}

.nav-frame h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--accent-color-2);
    text-shadow: var(--shadow-light);
}

.nav-button {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 12px;
    background: linear-gradient(145deg, var(--accent-color-1), var(--accent-color-2));
    color: var(--text-color);
    border: none;
    border-radius: 8px; /* More rounded buttons */
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    opacity: 0.9;
}

.nav-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
    opacity: 1;
}

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    background-color: var(--primary-bg);
    overflow: hidden;
}

/* Sections (Caches, Ideas, Settings) */
.section {
    flex-grow: 1;
    display: none;
    flex-direction: column;
    background-color: var(--primary-bg); /* Match body for seamless look */
    border-radius: 8px;
    overflow: hidden;
}

.section.active {
    display: flex;
}

.section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--text-color);
}

/* Top Frame within sections */
.top-frame {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.top-frame h2 {
    margin: 0;
    padding: 0;
}

.info-text {
    font-size: 14px;
    color: var(--subtle-text-color);
}

/* Scrollable Frame for lists */
.scroll-frame {
    flex-grow: 1;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

/* List Item Styles (for caches and ideas) */
.list-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    background-color: var(--accent-color-1);
    border-radius: 6px;
    overflow: hidden; /* Ensures inner button's border-radius is respected */
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-item-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.list-item-button {
    flex-grow: 1;
    text-align: left;
    padding: 10px 15px;
    background-color: transparent; /* No background, relies on parent */
    color: var(--text-color);
    border: none; /* No border */
    border-radius: 0; /* No individual button border radius */
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

.list-item-button:hover {
    background-color: var(--hover-effect);
}

/* Specific styling for the GC number part to make it stand out */
.list-item-button .gc-number-display {
    font-weight: bold;
    color: var(--accent-color-2);
    margin-right: 5px;
}


/* Add Idea Frame (bottom of Ideas section) */
.add-idea-frame {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.add-idea-frame input[type="text"] {
    flex-grow: 1;
}

/* Common Button Styles */
button {
    padding: 10px 20px;
    background: linear-gradient(145deg, var(--accent-color-2), #CC3A52); /* Gradient from vibrant red to darker red */
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    opacity: 0.9;
}
button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
    opacity: 1;
}

/* Secondary Button Style (for Choose Image) */
.secondary-button {
    background: linear-gradient(145deg, var(--accent-color-1), #0B2547); /* Darker blue gradient */
}
.secondary-button:hover {
    background: linear-gradient(145deg, #0B2547, var(--accent-color-1));
}


/* Specific button styles */
#add-new-cache-btn {
    width: 100%;
    margin-top: 15px;
    background: linear-gradient(145deg, var(--accent-color-2), #CC3A52);
}

/* Input Field Styles */
input[type="text"],
input[type="password"],
textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--input-text);
    padding: 10px 12px;
    border-radius: 6px;
    outline: none;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--accent-color-2);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: var(--subtle-text-color);
}

/* Settings Specifics */
#settings-section label {
    display: block;
    margin-top: 15px;
    margin-left: 20px;
    font-weight: bold;
    color: var(--text-color);
}
#settings-section input[type="text"] {
    width: calc(100% - 40px);
    margin: 8px 20px;
}
#settings-section button {
    margin: 15px 20px;
}
#api-save-status {
    margin-left: 20px;
    color: limegreen;
    font-size: 14px;
}
#bg-path-label {
    margin-left: 40px;
    font-size: 14px;
    color: var(--subtle-text-color);
}


/* Modals (Popups) - Basic Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Darker overlay */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Frosted glass effect */
}

.modal-content {
    background-color: var(--secondary-bg);
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 900px;
    border-radius: 12px; /* More rounded corners */
    box-shadow: var(--shadow-strong);
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: fadeIn 0.3s ease-out; /* Fade in animation */
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-button {
    color: var(--subtle-text-color);
    font-size: 32px; /* Larger close button */
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 25px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-color-2);
}

/* Geocache Detail Window Layout */
.geocache-detail-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px 20px; /* More spacing */
    padding-right: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.geocache-detail-grid label {
    text-align: right;
    padding-top: 5px;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-color);
}

.geocache-detail-grid input,
.geocache-detail-grid textarea {
    width: 100%;
    box-sizing: border-box;
}

.geocache-detail-grid textarea {
    min-height: 100px; /* Slightly taller */
}

.geocache-detail-grid .sticky-note-textbox {
    background-color: var(--yellow-note);
    color: var(--note-text-color);
    border: 1px solid #C0C000;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.detail-button-frame {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.detail-button-frame button {
    margin: 0; /* Remove individual margins */
}

.delete-button {
    background: linear-gradient(145deg, #D22B2B, #AA2222); /* Red gradient */
}
.delete-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    opacity: 0.9;
}

/* Custom Fields Section */
.custom-fields-container {
    display: flex;
    flex-direction: column;
    gap: 8px; /* More spacing */
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg); /* Match input background */
}
.custom-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.custom-field-row input {
    flex: 1;
}
.custom-field-row .remove-custom-field-btn {
    width: 35px; /* Slightly larger X button */
    height: 35px; /* Make it square */
    padding: 0;
    background: linear-gradient(145deg, #D22B2B, #AA2222);
    border-radius: 50%; /* Make it round */
    font-size: 1.1em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-light);
}
.custom-field-row .remove-custom-field-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.separator {
    height: 1px; /* Thinner separator */
    background-color: var(--border-color);
    margin: 25px 0; /* More vertical space */
}

/* Password Modal Specifics */
.small-modal {
    max-width: 450px;
    padding: 40px;
    text-align: center;
}

#password-input {
    width: calc(100% - 24px); /* Account for padding */
    padding: 12px;
    font-size: 18px;
    margin-top: 15px;
}

#password-error {
    color: #FF6B6B; /* Softer red for errors */
    font-size: 15px;
    height: 1.5em; /* Reserve space */
    margin-top: 10px;
}
#password-submit-btn {
    margin-top: 25px;
    width: 150px; /* Fixed width login button */
}

/* Idea Development Modal Specifics */
.idea-dev-modal-content {
    max-width: 1400px; /* Even wider for large screens */
    width: 98%; /* Take up more of the screen */
    height: 95vh; /* Take up more of the viewport height */
    padding: 20px;
    border-radius: 12px;
}

#idea-dev-modal-title {
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: var(--shadow-light);
}
#idea-title-display {
    color: var(--accent-color-2);
}

.idea-dev-paned-window {
    display: flex;
    flex-grow: 1;
    gap: 20px; /* More space between panes */
    overflow: hidden;
}

.idea-dev-left-pane {
    flex-basis: 70%;
    display: flex;
    flex-direction: column;
    background-color: #2F4F4F; /* Dark slate gray, slightly adjusted */
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-medium);
}

.notes-area {
    flex-grow: 1;
    position: relative;
    overflow: auto;
    padding: 20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.notes-area.has-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.idea-dev-chat-pane {
    flex-basis: 30%;
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
}

.chat-title {
    font-size: 20px;
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent-color-2);
    font-weight: bold;
}

.chat-history-textbox {
    flex-grow: 1;
    background-color: #FFFFFF; /* White background for chat history */
    color: #333333; /* Dark text for chat history */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    overflow-y: auto;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* AI status box styling specific to geocache modal */
.ai-status-box {
    margin-top: 10px;
    background-color: var(--input-bg); /* Darker background */
    color: var(--text-color); /* Light text color */
    border-color: var(--border-color);
    min-height: 40px; /* Give it some minimum height */
}


.chat-history-textbox strong {
    color: var(--accent-color-2); /* Highlight role names */
}

.chat-history-textbox .system-message {
    color: var(--subtle-text-color);
}
.chat-history-textbox .error-message {
    color: #FF6B6B;
}


.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex-grow: 1;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 15px;
}

.chat-send-button {
    padding: 10px 20px;
    background: linear-gradient(145deg, var(--accent-color-2), #CC3A52);
    border-radius: 6px;
}
.chat-send-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* AI Geocache Bar specific styling */
.ai-geocache-bar {
    background-color: var(--accent-color-1); /* Blue color as requested */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    align-items: center;
    box-shadow: var(--shadow-light);
}
.ai-geocache-bar .chat-input {
    flex-grow: 1;
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--input-text);
}
.ai-geocache-bar .chat-send-button {
    flex-shrink: 0; /* Prevent shrinking */
}


/* Image Upload Section */
.image-upload-area {
    display: flex;
    flex-wrap: wrap; /* Allow buttons/previews to wrap */
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px; /* Space between buttons and images */
    width: 100%; /* Take full width */
    max-height: 250px; /* Limit height of preview container */
    overflow-y: auto; /* Enable scrolling if many images */
    padding-bottom: 5px; /* Padding for scrollbar */
}

.image-thumbnail-wrapper {
    position: relative;
    width: 150px; /* Fixed thumbnail size */
    height: 150px; /* Fixed thumbnail size */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0F3460; /* Placeholder background */
}

.image-thumbnail {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensure image fits without cropping */
    display: block;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(210, 43, 43, 0.8); /* Semi-transparent red */
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 0.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-light);
}
.delete-image-btn:hover {
    background-color: #D22B2B;
    transform: scale(1.1);
}


/* Sticky Note Styles */
.sticky-note {
    position: absolute;
    width: 240px; /* Slightly wider notes */
    min-height: 120px; /* Min height */
    max-height: 350px; /* Max height */
    border-radius: 10px; /* More rounded */
    padding: 15px;
    box-shadow: var(--shadow-medium); /* Stronger shadow */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both; /* Allows user resizing */
    min-width: 180px;
    min-height: 100px;
    box-sizing: border-box;
    cursor: grab; /* Indicate draggable */
    transition: box-shadow 0.2s ease;
}
.sticky-note:hover {
    box-shadow: var(--shadow-strong);
}

.sticky-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Pin & Close buttons */
.sticky-note-flag, .sticky-note-close {
    cursor: pointer;
    font-size: 1.4em; /* Larger icons */
    font-weight: bold;
    color: var(--subtle-text-color);
    transition: color 0.2s ease, transform 0.2s ease;
    user-select: none; /* Prevent text selection on icon */
}
.sticky-note-flag:hover, .sticky-note-close:hover {
    transform: scale(1.1);
}

.sticky-note-flag.flagged {
    color: gold; /* Gold when flagged */
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); /* Subtle glow */
}
.sticky-note-close:hover {
    color: #D22B2B;
}

/* Pin icon specific styling */
.sticky-note-pin {
    cursor: pointer;
    font-size: 1.4em; /* Larger icon */
    color: var(--subtle-text-color);
    transition: color 0.2s ease, transform 0.2s ease;
    user-select: none;
    margin-left: auto; /* Push it to the left of the close button */
    margin-right: 10px; /* Space from close button */
}
.sticky-note-pin.pinned {
    color: #6495ED; /* Cornflower Blue when pinned */
    text-shadow: 0 0 5px rgba(100, 149, 237, 0.5); /* Subtle blue glow */
}
.sticky-note-pin:hover {
    transform: scale(1.1);
    color: #6495ED; /* Also color on hover */
}


.sticky-note-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95em;
    color: var(--note-text-color); /* Ensure text color is applied */
}

.sticky-note-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}
.sticky-note-footer button {
    padding: 5px 10px;
    font-size: 0.85em;
    border-radius: 5px;
    background-color: rgba(0,0,0,0.2); /* Semi-transparent */
    color: var(--text-color);
    box-shadow: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.sticky-note-footer button:hover {
    background-color: rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

/* Note Colors */
.sticky-note.color-red {
    background-color: var(--red-note);
    border: 1px solid #FF8888;
}
.sticky-note.color-yellow {
    background-color: var(--yellow-note);
    border: 1px solid #CCCC00;
}
.sticky-note.color-blue { /* For Pinned notes */
    background-color: var(--pinned-note);
    border: 1px solid #6495ED; /* Cornflower Blue */
    box-shadow: 0 0 10px rgba(100, 149, 237, 0.6); /* Blue glow for pinned */
}


/* Image inside sticky note */
.sticky-note-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px; /* More space below image */
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}


/* ====================================================================
   Mobile Optimization (Responsive Design) - General & iOS Specifics
   ==================================================================== */

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        /* iOS Safari often needs this for smooth scrolling */
        -webkit-overflow-scrolling: touch;
    }

    .container {
        flex-direction: column;
        height: auto;
        border-radius: 0; /* Full screen on mobile */
        box-shadow: none;
    }

    .nav-frame {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px 5px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Shadow for bottom of nav */
    }

    .nav-frame h1 {
        display: none;
    }

    .nav-button {
        flex-grow: 1;
        margin: 0 3px; /* Tighter spacing */
        padding: 10px 8px;
        font-size: 15px;
        border-radius: 6px;
        box-shadow: none; /* Lighter shadows on mobile */
    }
    .nav-button:hover, .nav-button:active {
        transform: none; /* No transform on mobile touch */
        box-shadow: none;
    }
    /* Ensure tap highlight is subtle for iOS */
    .nav-button {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }


    .content-area {
        flex-direction: column;
        padding: 10px; /* Reduced padding */
    }

    .section {
        padding: 10px;
        margin-bottom: 15px; /* Spacing between sections */
        border-radius: 8px; /* Maintain rounded corners for sections */
    }

    .section.active {
        display: flex;
    }

    .top-frame {
        flex-direction: column;
        align-items: center; /* Center align elements */
        gap: 8px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .top-frame h2 {
        width: 100%;
        text-align: center;
        font-size: 20px; /* Smaller font size */
        margin-bottom: 5px;
    }

    .info-text {
        width: 100%;
        text-align: center;
        font-size: 13px;
    }

    #refresh-caches-btn,
    #refresh-ideas-btn,
    #add-new-cache-btn {
        width: 100%;
        margin-top: 10px;
        padding: 12px; /* Larger touch target */
        font-size: 16px;
        box-shadow: var(--shadow-light); /* Keep subtle shadow */
    }

    .add-idea-frame {
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
    }
    .add-idea-frame button {
        padding: 12px; /* Larger touch target */
        font-size: 16px;
    }


    .list-item-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0; /* Remove gap when stacking */
        margin-bottom: 10px; /* More space between stacked items */
        border-radius: 8px; /* Larger border-radius */
    }
    .list-item-row:hover {
        transform: none; /* No transform on mobile touch */
        box-shadow: var(--shadow-light);
    }

    .list-item-button {
        padding: 12px 15px; /* Larger touch target */
        font-size: 15px;
        border-radius: 8px 8px 0 0; /* Round top corners only */
        text-align: center;
        overflow: visible; /* Allow text to wrap if necessary for long descriptions */
        white-space: normal;
        line-height: 1.4;
    }

    .delete-button {
        width: 100%;
        margin-left: 0;
        padding: 10px; /* Larger touch target */
        border-radius: 0 0 8px 8px; /* Round bottom corners only */
        font-size: 15px;
        box-shadow: none; /* No shadow */
    }
    .delete-button:hover, .delete-button:active {
        transform: none;
        box-shadow: none;
    }

    /* Modals responsiveness */
    .modal-content {
        width: 95%;
        max-width: unset;
        margin: 10px;
        padding: 20px;
        border-radius: 10px;
        box-shadow: var(--shadow-strong); /* Maintain strong shadow */
    }

    /* Geocache Detail Grid responsiveness */
    .geocache-detail-grid {
        grid-template-columns: 1fr; /* Stack labels and inputs vertically */
        gap: 10px; /* Smaller gap */
        padding-right: 0;
    }

    .geocache-detail-grid label {
        text-align: left;
        padding-top: 0;
        font-weight: bold;
    }

    .geocache-detail-grid input,
    .geocache-detail-grid textarea {
        padding: 12px; /* Larger touch target */
        font-size: 16px;
    }

    .custom-fields-container {
        padding: 8px;
        border: 1px dashed var(--border-color); /* Re-add dashed border for clarity */
    }

    .custom-field-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
    }
    .custom-field-row input {
        padding: 12px;
    }
    .custom-field-row .remove-custom-field-btn {
        width: 100%;
        height: auto; /* Allow height to adjust */
        padding: 8px; /* Larger touch target */
        border-radius: 6px; /* Rectangular button */
        font-size: 1.1em;
        box-shadow: none;
    }
    .custom-field-row .remove-custom-field-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .detail-button-frame {
        flex-direction: column;
        gap: 10px;
    }

    .detail-button-frame button {
        width: 100%;
        padding: 12px; /* Larger touch target */
        font-size: 16px;
    }

    #settings-section label,
    #settings-section input[type="text"],
    #settings-section input[type="password"],
    #settings-section button,
    #api-save-status,
    #bg-path-label {
        margin-left: 0;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 12px; /* For labels/status to make them touch-friendly if they were interactive */
        font-size: 16px;
    }
    #api-key-entry {
        padding: 12px;
    }
    #save-api-key-btn, #set-background-image-btn {
        padding: 12px;
    }


    /* Idea Development Modal Responsiveness */
    .idea-dev-modal-content {
        flex-direction: column;
        height: 98vh; /* Take up more height */
        padding: 15px;
    }
    .idea-dev-paned-window {
        flex-direction: column;
        gap: 15px;
        overflow-y: auto;
    }
    .idea-dev-left-pane,
    .idea-dev-chat-pane {
        flex-basis: auto;
        width: 100%;
        min-height: 250px; /* Ensure sufficient height for each pane */
        height: auto;
        border-radius: 10px;
    }
    .notes-area {
        padding: 15px;
    }
    .chat-input-area {
        flex-direction: column;
    }
    .chat-input {
        padding: 12px; /* Larger touch target */
        font-size: 16px;
    }
    .chat-send-button {
        width: 100%;
        padding: 12px; /* Larger touch target */
        font-size: 16px;
    }
    .sticky-note {
        position: static; /* Remove absolute positioning on mobile */
        margin-bottom: 15px; /* Add spacing when stacked */
        width: 100%; /* Full width for notes on mobile */
        max-height: unset;
        resize: none; /* Disable resizing on mobile */
        box-shadow: var(--shadow-medium); /* Retain moderate shadow */
        cursor: default; /* Not draggable on mobile (static position) */
        padding: 15px;
    }
    .sticky-note:hover {
        box-shadow: var(--shadow-medium); /* No hover effect on mobile */
    }
    .sticky-note-header {
        justify-content: space-between; /* Keep pins/close on ends */
    }
    .sticky-note-flag, .sticky-note-close {
        font-size: 1.6em; /* Even larger touch targets for icons */
        padding: 5px; /* Ensure touchable area */
    }

    /* AI Geocache bar on mobile */
    .ai-geocache-bar {
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 15px;
    }
    .ai-geocache-bar .chat-input, .ai-geocache-bar .chat-send-button {
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
    }
    .ai-geocache-bar .chat-input {
        margin-bottom: 5px;
    }

    /* Image upload on mobile */
    .image-upload-area {
        flex-direction: column;
        align-items: stretch;
    }
    .image-upload-area button {
        width: 100%;
        padding: 12px;
    }
    .image-preview-container {
        justify-content: center; /* Center images if few */
    }
    .image-thumbnail-wrapper {
        width: 120px;
        height: 120px;
    }

}

/* Specific iOS-like scrolling behavior */
.scroll-frame, .chat-history-textbox, .notes-area, .geocache-detail-grid, .image-preview-container {
    -webkit-overflow-scrolling: touch;
}