:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --bg-color: #F3F4F6;
    --surface-color: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --border-color: #E5E7EB;
    --error-color: #EF4444;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #6366F1;
    --primary-hover: #818CF8;
    --secondary-color: #34D399;
    --bg-color: #111827;
    --surface-color: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --border-color: #374151;
    --glass-bg: rgba(31, 41, 55, 0.85);
    --glass-border: rgba(55, 65, 81, 0.5);
}

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

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    transition: var(--transition);
    min-height: 100vh;
}

/* Header */
.app-header {
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.instructions {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--surface-color);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.location-group {
    margin-bottom: 1rem;
}

.location-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.input-wrapper.stop-wrapper i {
    color: var(--primary-color);
}

.input-wrapper .start-icon { color: var(--secondary-color); }
.input-wrapper .end-icon { color: var(--error-color); }

input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

input[readonly] {
    background-color: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.7;
    font-weight: 500;
}

/* Stops container */
.stops-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
}

.stop-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    animation: fadeIn 0.3s ease;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.stop-row .input-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.stop-row .icon-btn,
.stop-row .remove-btn {
    flex: 0 0 auto;
}

gmp-place-autocomplete, .stop-input-autocomplete {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-family: inherit;
    box-sizing: border-box !important;
}

/* Settings modal autocomplete */
.settings-autocomplete-wrapper {
    width: 100%;
}

/* Checkbox styling */
.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

/* Info tooltip styling */
.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--primary-color);
    cursor: help;
}

.info-tooltip i {
    font-size: 0.875rem;
}

.tooltip-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
    z-index: 1000;
    margin-top: 0.5rem;
}

.tooltip-content strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.tooltip-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.tooltip-content a:hover {
    text-decoration: underline;
}

.info-tooltip:hover .tooltip-content {
    display: block;
}

/* Arrow for tooltip */
.tooltip-content::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--surface-color);
}

.settings-autocomplete-wrapper gmp-place-autocomplete,
.settings-autocomplete {
    width: 100%;
    font-family: inherit;
}

.settings-autocomplete-wrapper input,
.settings-location-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--input-background);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

.settings-autocomplete-wrapper input:focus,
.settings-location-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Fallback input */
.stop-input-fallback {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.stop-input-fallback:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.w-100 { width: 100%; }
.mt-3 { margin-top: 1rem; }

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

.secondary-btn {
    background: var(--surface-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background: var(--primary-color);
    color: white;
}

.outline-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.outline-btn:hover:not(:disabled) {
    background: var(--bg-color);
    border-color: var(--text-secondary);
}

.text-btn {
    background: transparent;
    border: none;
    font-weight: 500;
}

.text-danger { color: var(--error-color); }
.text-danger:hover { background: rgba(239, 68, 68, 0.1); border-radius: 8px; }

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
    box-shadow: none !important;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--primary-color);
    background: var(--bg-color);
}

.actions-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.secondary-actions {
    display: flex;
    gap: 0.5rem;
}
.secondary-actions button {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
    min-width: 0;
}

.map-container {
    height: 450px;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

/* Google Maps control styling */
.map-container .gm-style .gm-style-mtc {
    font-family: inherit !important;
}

.map-container .gm-style .gm-style-mtc button {
    background: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    font-size: 0.875rem !important;
    padding: 8px 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.map-container .gm-style .gm-style-mtc button:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.map-container .gm-style .gm-style-mtc .gm-style-mtc-menu {
    background: var(--surface-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.map-container .gm-style .gm-style-mtc .gm-style-mtc-menu div {
    color: var(--text-primary) !important;
    font-size: 0.875rem !important;
    padding: 8px 12px !important;
}

.map-container .gm-style .gm-style-mtc .gm-style-mtc-menu div:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: calc(var(--border-radius) - 0.5rem);
    background-color: var(--border-color); 
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.map-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.hidden {
    display: none !important;
}

/* Summary Panel */
.route-summary-panel {
    animation: fadeIn 0.5s ease;
}

.summary-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.itinerary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.itinerary-item {
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 0;
}

.itinerary-item__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.itinerary-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: -20px;
    width: 2px;
    background: var(--border-color);
    z-index: 1;
}

.item-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 2;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-marker.start-marker { background: var(--secondary-color); }
.item-marker.end-marker { background: var(--error-color); }

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-address-box {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.item-address {
    font-weight: 600;
    line-height: 1.4;
    gap: 0.35rem;
}

.item-connector {
    display: flex;
    align-items: center;
    padding: 1rem 0 0;
    position: relative;
    z-index: 2;
}

.item-connector::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid var(--bg-color);
    margin-left: 9px;
    flex-shrink: 0;
}

.item-leg-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    background: var(--bg-color);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-left: 1.5rem;
}

.item-leg-info span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.item-leg-info i {
    color: var(--primary-color);
}

/* Loading & Errors */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(79, 70, 229, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error-message {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #F87171;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-message::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

[data-theme="dark"] .error-message {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

/* Print Styles */
.print-only { display: none; }

@media print {
    .no-print { display: none !important; }
    .print-only { display: block; }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .app-container {
        display: block;
        margin: 0;
        padding: 0;
    }

    h1 {
        border-bottom: 2px solid #ccc;
        padding-bottom: 10px;
        margin-bottom: 20px;
        color: #333;
    }

    .print-stats {
        display: flex;
        gap: 30px;
        margin-bottom: 30px;
        font-weight: bold;
        padding: 15px;
        background: #f9f9f9;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    .print-itinerary-item {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #eee;
        page-break-inside: avoid;
    }

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

    .print-leg-info {
        font-size: 0.9em;
        color: #555;
        margin-top: 8px;
        font-style: italic;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.modal-body input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.modal-body small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-body small a {
    color: var(--primary-color);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }
    
    .map-container {
        height: 350px;
    }
    
    .secondary-actions {
        flex-wrap: wrap;
    }
    
    .stat-box {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

/* Mobile breakpoint for small screens */
@media (max-width: 600px) {
    .app-container {
        padding: 0 0.5rem;
        margin: 0.5rem auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .app-header {
        padding: 0.5rem;
    }
    
    .header-content {
        padding: 0 0.25rem;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .header-buttons .icon-btn {
        width: 32px;
        height: 32px;
        padding: 0.4rem;
    }
    
    .controls-section {
        padding: 0.75rem;
    }
    
    .primary-actions {
        flex-direction: column;
    }
    
    .primary-actions button {
        width: 100%;
    }
    
    .secondary-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .secondary-actions button {
        flex: none;
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-box {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .map-container {
        height: 280px;
        padding: 0.25rem;
    }
    
    .itinerary-item {
        padding: 0.75rem;
    }
    
    .item-marker {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .stop-row {
        padding: 0.5rem;
        gap: 0.35rem;
    }
    
    .stop-row > * {
        max-width: 100%;
    }
    
    .address-input-wrapper {
        min-width: 0;
        flex: 1;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .tooltip-content {
        width: 200px;
        left: auto;
        right: 0;
        transform: none;
    }
    
    .tooltip-content::after {
        left: auto;
        right: 10px;
    }
    
    /* Fix for Google Maps autocomplete overflow */
    gmp-place-autocomplete {
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    .stop-input-autocomplete {
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Ensure all direct children of stop-row shrink properly */
    .stop-row .icon-btn {
        flex-shrink: 0;
    }
    
    /* Fix glass panels on mobile */
    .glass-panel {
        max-width: 100%;
    }
    
    /* Modal content fix */
    .modal-content {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem;
    }
    
    /* Stops container */
    .stops-container {
        padding: 0.75rem 0;
    }
    
    /* Input wrapper */
    .input-wrapper {
        max-width: 100%;
    }
    
    input[type="text"] {
        font-size: 16px; /* Prevent iOS zoom on focus */
        padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    }
    
    /* Mobile itinerary fixes */
    .itinerary-item__header {
        gap: 0.75rem;
    }
    
    .item-address-box {
        padding: 0.75rem;
    }
    
    .item-address {
        font-size: 0.9rem;
    }
    
    .item-connector {
        padding: 0.75rem 0 0;
    }
    
    .item-leg-info {
        margin-left: 1.25rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.75rem;
    }
}

/* Extra small devices (iPhone 17 Pro, etc.) */
@media (max-width: 420px) {
    .app-container {
        padding: 0 0.35rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    body {
        min-width: 0;
    }
    
    .app-header h1 {
        font-size: 0.9rem;
    }
    
    .app-header h1 i {
        display: none; /* Hide icon to save space */
    }
    
    .controls-section {
        padding: 0.5rem;
    }
    
    .stop-row {
        gap: 0.25rem;
    }
    
    .icon-btn {
        width: 28px;
        height: 28px;
        padding: 0.3rem;
    }
    
    /* Make sure map doesn't overflow */
    .map-container {
        min-width: 0;
    }
    
    #map {
        min-width: 0;
    }
    
    /* Ensure glass panels don't overflow */
    .glass-panel {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .itinerary-item {
        padding: 0.0;
    }

    .itinerary-item:not(:last-child)::after {
        bottom: -40px;
        left: 13px;
    }

    .item-connector::before {
        margin-left: 7px;
    }
}
