/**
 * TravelMate - Styles
 * Modern, responsive design for travel planning
 */

:root {
    --primary-color: #6366f1;
    --primary-rgb: 99, 102, 241;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f97316;
    --success-color: #22c55e;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    overflow-x: hidden;
}

/* Navigation Header */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-inverse);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content */
.main-content {
    margin-top: 4rem;
    height: calc(100vh - 4rem);
    display: flex;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 4rem;
    left: 0;
    width: 400px;
    height: calc(100vh - 4rem);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: var(--transition);
    z-index: 900;
    box-shadow: var(--shadow-lg);
}

.sidebar.open {
    transform: translateX(0);
}

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

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
    transition: var(--transition);
}

/* When sidebar is open, add left margin to map container */
.sidebar.open ~ .map-container {
    margin-left: 400px;
}

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

/* Map Controls */
.map-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.control-btn:hover {
    background: var(--bg-tertiary);
}

.control-btn i {
    font-size: 1.125rem;
    color: var(--text-primary);
}

/* Status Messages */
.status-message {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.status-message.show {
    opacity: 1;
}

.status-message.success {
    background: var(--success-color);
    color: var(--text-inverse);
}

.status-message.error {
    background: var(--danger-color);
    color: var(--text-inverse);
}

.status-message.info {
    background: var(--primary-color);
    color: var(--text-inverse);
}

/* Authentication Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-body {
    padding: 0 2rem 2rem 2rem;
}

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

.auth-toggle {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.auth-toggle button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}

/* Guest Banner */
.guest-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-inverse);
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
}

.guest-banner h3 {
    margin-bottom: 0.5rem;
}

.guest-banner p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .sidebar {
        width: 320px;
    }

    .sidebar.open ~ .map-container {
        margin-left: 0;
    }

    .sidebar.open ~ .map-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-overlay);
        z-index: 400;
        pointer-events: auto;
        cursor: pointer;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
    }

    .nav-brand {
        font-size: 1.125rem;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar.open ~ .map-container {
        margin-left: 0;
    }

    .modal {
        margin: 0 0.5rem;
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar,
.modal::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* Route Animation */
.route-animation {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawRoute 2s ease-in-out forwards;
}

@keyframes drawRoute {
    to {
        stroke-dashoffset: 0;
    }
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Map Context Menu */
.map-context-menu {
    position: absolute;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1001;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

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

.context-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.context-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.context-menu-item:hover i {
    color: var(--primary-color);
}

/* Add Place Mode Button */
.control-btn.active {
    background: var(--primary-color);
    color: white;
}

.control-btn.active:hover {
    background: var(--primary-dark);
}

/* Form Text Helper */
.form-text {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Extension protection styles */
html, body {
    /* transform on html/body made it the containing block for position:fixed,
       which pushed the fixed navbar 4rem down over the map. Removed. */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Защита от автозамены стилей расширениями */
.btn, button {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    border: 1px solid transparent !important;
    text-shadow: none !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Защита модалов */
.modal-overlay {
    position: fixed !important;
    z-index: 9999 !important;
    backdrop-filter: blur(4px) !important;
}

/* Защита навигации */
.navbar {
    position: fixed !important;
    z-index: 1000 !important;
}

/* Place Markers */
.custom-place-marker {
    background: none !important;
    border: none !important;
}

.place-marker {
    width: 30px;
    height: 30px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.place-marker:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Place Popup */
.place-popup-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.place-popup h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.place-category {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.place-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.place-actions {
    display: flex;
    gap: 0.5rem;
}

.place-popup .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Enhanced Modal Styles */
.modal-large {
    max-width: 600px;
    width: 90vw;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Photo Upload Styles */
.photo-upload-container {
    width: 100%;
}

.photo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.photo-upload-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.photo-upload-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.photo-upload-placeholder p {
    margin: 0.5rem 0 0.25rem 0;
    font-weight: 500;
    color: var(--text-secondary);
}

.photo-upload-placeholder small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.photo-preview {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.photo-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.photo-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Custom Fields Styles */
.custom-fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.btn-toggle {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.custom-fields-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: var(--bg-secondary);
    animation: fadeIn 0.3s ease-in-out;
}

.custom-field-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: end;
    margin-bottom: 0.75rem;
}

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

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.05);
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 100px;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Public Places Markers */
.custom-public-marker {
    background: none !important;
    border: none !important;
}

.public-place-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.marker-icon {
    background: var(--bg-primary);
    border: 2px solid var(--success-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: var(--shadow-md);
    z-index: 2;
    position: relative;
}

.marker-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 2px solid var(--success-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
}

/* Public Place Popup */
.public-place-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
}

.public-place-content {
    padding: 1rem;
    max-width: 280px;
}

.place-header {
    margin-bottom: 0.75rem;
    max-width: 100%;
    overflow: hidden;
}

.place-item-enhanced .place-header {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 100% !important;
    overflow: hidden !important;
}

.place-item-enhanced .place-title {
    flex: 1;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.place-item-enhanced .place-name {
    margin: 0 0 0.25rem 0 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

.place-item-enhanced .place-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
}

.place-header h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-icon {
    font-size: 1.1rem;
}

.place-category {
    color: var(--success-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
}

.profile-section {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    max-width: 100%;
    overflow-x: hidden;
}

.places-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
    overflow-x: hidden;
}

.place-item-enhanced {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
}

.place-item-enhanced:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.place-item-enhanced .place-image {
    display: none !important;
}

/* Photo Gallery Modal */
.photo-gallery-modal {
    max-width: 900px;
    width: 90%;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

.primary-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.photo-count {
    margin-left: 0.25rem;
    font-size: 0.75rem;
}

.place-item-enhanced .place-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
}

.place-image {
    margin: 0.75rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
}

.place-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.place-description-wrapper {
    margin: 0.75rem 0;
    max-width: 100% !important;
    overflow: hidden !important;
}

.place-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    overflow: hidden !important;
    transition: max-height 0.3s ease;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    white-space: pre-wrap !important;
}

.place-description.collapsed {
    max-height: 4.2em; /* ~3 lines with line-height 1.4 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.place-description.expanded {
    max-height: none;
    display: block;
}

.description-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.description-toggle:hover {
    color: var(--accent-hover);
}

.description-toggle i {
    font-size: 0.75rem;
}

.custom-fields {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.custom-fields h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-field {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    line-height: 1.3;
}

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

.custom-field strong {
    color: var(--text-primary);
}

.place-website {
    margin: 0.75rem 0;
}

.place-website a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.place-website a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.place-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.place-meta small {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* ===== Multi-stop route planner ===== */
.wp-list { display: flex; flex-direction: column; gap: 0.35rem; }
.wp-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 0.9rem; border: 1px dashed var(--border-color); border-radius: var(--radius-md); }
.wp-item { display: flex; align-items: center; gap: 0.3rem; }
.wp-num { flex: 0 0 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.wp-name { flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 0.3rem 0.45rem; border: 1px solid var(--border-color); border-radius: 6px; background: transparent; color: inherit; }
.wp-btn { flex: 0 0 26px; height: 26px; border: 1px solid var(--border-color); border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 0.7rem; }
.wp-btn:hover:not(:disabled) { background: rgba(99,102,241,0.08); color: #6366f1; }
.wp-btn:disabled { opacity: 0.3; cursor: default; }
.wp-del:hover:not(:disabled) { color: #ef4444; background: rgba(239,68,68,0.08); }
.wp-tools { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.15rem; }
.wp-link { border: none; background: none; color: var(--text-muted); font-size: 0.75rem; cursor: pointer; padding: 0; }
.wp-link:hover { color: #6366f1; }
.wp-start { background: #22c55e; } .wp-mid { background: #6366f1; } .wp-end { background: #ef4444; }
.wp-marker-wrap { background: none; border: none; }
.wp-marker { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); color: #fff; font: 600 13px/24px Inter, sans-serif; text-align: center; }
.wp-summary { margin-top: 0.6rem; padding: 0.6rem 0.7rem; border-radius: var(--radius-md); background: rgba(99,102,241,0.06); font-size: 0.85rem; }
.wp-summary.muted { color: var(--text-muted); } .wp-summary.error { background: rgba(239,68,68,0.08); color: #b91c1c; }
.wp-total { margin-bottom: 0.3rem; }
.wp-leg { display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; font-size: 0.78rem; color: var(--text-secondary); padding: 0.1rem 0; }
.sr-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.sr-item { display: flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border-color); border-radius: 6px; padding: 0.35rem 0.45rem; }
.sr-text { flex: 1; min-width: 0; cursor: pointer; font-size: 0.82rem; overflow: hidden; }
.sr-text small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sr-empty { font-size: 0.82rem; color: var(--text-muted); }

/* ===== Places along the route ===== */
.poi-mode { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; }
.poi-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; font-size: 0.85rem; }
.poi-cats label, .poi-mode label { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.poi-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 380px; max-width: calc(100% - 80px); flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 1000; overflow: hidden; }
.poi-panel.collapsed { bottom: auto; }
.poi-panel.collapsed .poi-list, .poi-panel.collapsed .poi-stats { display: none; }
.poi-panel-head { position: relative; padding: 0.7rem 4.2rem 0.6rem 0.9rem; border-bottom: 1px solid #e5e7eb; flex: 0 0 auto; }
.poi-panel-head h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.poi-close, .poi-min { position: absolute; top: 6px; border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #6b7280; padding: 4px 6px; }
.poi-close { right: 6px; } .poi-min { right: 34px; font-size: 16px; top: 9px; }
.poi-close:hover, .poi-min:hover { color: #111827; }
.poi-stats { font-size: 0.72rem; color: #4b5563; line-height: 1.45; }
.poi-srcs { margin: 0.25rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.poi-src { background: #eef2ff; color: #4338ca; border-radius: 4px; padding: 0 0.35rem; }
.poi-src.off { background: #f3f4f6; color: #9ca3af; }
.poi-meta { color: #9ca3af; }
.poi-err { color: #b45309; cursor: help; }
.poi-list { flex: 1 1 auto; overflow-y: auto; padding: 0.5rem 0.6rem; }
.poi-empty { text-align: center; color: #9ca3af; font-size: 0.85rem; }
.poi-item { border: 1px solid #e5e7eb; border-radius: 8px; padding: 0.45rem 0.55rem; margin-bottom: 0.4rem; }
.poi-item:hover, .poi-item.open { border-color: #a5b4fc; }
.poi-top { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.poi-ico { flex: 0 0 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.poi-title { flex: 1; min-width: 0; font-size: 0.83rem; line-height: 1.25; }
.poi-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poi-title small { color: #6b7280; }
.poi-score { font-weight: 700; font-size: 0.75rem; color: #4338ca; background: #eef2ff; border-radius: 6px; padding: 0.1rem 0.35rem; }
.poi-body { display: none; }
.poi-item.open .poi-body { display: block; }
.poi-sum { display: flex; gap: 0.5rem; font-size: 0.75rem; color: #374151; line-height: 1.35; margin: 0.4rem 0 0.2rem; }
.poi-sum img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; flex: 0 0 84px; }
.poi-sum.muted { color: #9ca3af; }
.poi-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; margin-top: 0.3rem; }
.poi-links a { color: #4f46e5; text-decoration: none; }
.poi-links a:hover { text-decoration: underline; }
.poi-add { border: none; background: #6366f1; color: #fff; border-radius: 6px; padding: 0.2rem 0.55rem; font-size: 0.72rem; cursor: pointer; }
.poi-add:hover { background: #4f46e5; }
.poi-why { font-size: 0.7rem; color: #9ca3af; margin-top: 0.2rem; }
.poi-why summary { cursor: pointer; }
.poi-why ul { margin: 0.2rem 0 0 1rem; padding: 0; color: #6b7280; }
.poi-pop { font-size: 0.8rem; }
.poi-pop .poi-sum img { width: 72px; height: 72px; flex-basis: 72px; }
.poi-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.75rem; }
.poi-marker-wrap { background: none; border: none; }
.poi-marker { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; font-size: 13px; transition: transform .15s; }
.poi-hl .poi-marker { transform: scale(1.5); }

/* ===== Legs between stops (road / ferry) ===== */
.wp-leg-row { display: flex; align-items: center; gap: 0.4rem; margin: -0.1rem 0 -0.1rem 0.15rem; padding-left: 0.2rem; border-left: 2px dotted #c7d2fe; min-height: 22px; }
.wp-leg-row.is-ferry { border-left: 2px dashed #0284c7; }
.leg-mode { border: 1px solid var(--border-color); background: #fff; border-radius: 6px; font-size: 0.8rem; line-height: 1; padding: 2px 4px; cursor: pointer; }
.leg-mode:hover { border-color: #6366f1; }
.leg-info { font-size: 0.72rem; color: var(--text-muted); }
.leg-ferry { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.2rem 1.6rem; font-size: 0.75rem; }
.leg-hours { width: 3.2rem; font: inherit; padding: 1px 4px; border: 1px solid var(--border-color); border-radius: 4px; }
.leg-date { font: inherit; font-size: 0.72rem; padding: 1px 2px; border: 1px solid var(--border-color); border-radius: 4px; }
.leg-find { font-size: 0.75rem !important; color: #0284c7 !important; }
.ferry-box { margin: 0 0 0.3rem 1.6rem; font-size: 0.75rem; }
.ferry-box:empty { display: none; }
.ferry-opt { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; border: 1px solid #e0f2fe; background: #f0f9ff; border-radius: 6px; padding: 0.3rem 0.45rem; margin-bottom: 0.25rem; }
.ferry-opt small { color: #6b7280; }
.ferry-actions { display: flex; gap: 0.4rem; align-items: center; white-space: nowrap; }
.ferry-actions a.poi-add { text-decoration: none; }
.ferry-msg { color: #6b7280; margin-bottom: 0.25rem; }
.ferry-msg.err { color: #b45309; cursor: help; }
.ferry-links { color: #6b7280; } .ferry-links a { color: #4f46e5; }
.ferry-src { color: #9ca3af; font-size: 0.68rem; }
.leg-hint { border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; border-radius: 6px; font-size: 0.72rem; padding: 1px 6px; margin-top: 2px; cursor: pointer; }
.leg-hint:hover { background: #fef3c7; }
.ferry-raw { margin: 0.2rem 0; color: #6b7280; } .ferry-raw summary { cursor: pointer; }
.ferry-raw pre { max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: 0.65rem; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 4px; padding: 4px; }
.ferry-use { border: 1px solid #0284c7; background: #fff; color: #0284c7; border-radius: 6px; font-size: 0.72rem; padding: 0.15rem 0.45rem; cursor: pointer; }
.ferry-use:hover { background: #e0f2fe; }
.wp-leg-row.is-flight { border-left: 2px dashed #7c3aed; }
.leg-find-flight { color: #7c3aed !important; }
.flight-opt { border-color: #ede9fe; background: #f5f3ff; }
.flight-opt .ferry-use { border-color: #7c3aed; color: #7c3aed; }
.unsaved-bar { display: none; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; padding: 0.35rem 0.6rem; border-radius: var(--radius-md); background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; font-size: 0.8rem; }
.unsaved-bar .wp-link { color: #b45309; font-weight: 600; }

/* ===== Trip: days, stop types, overnight ===== */
.trip-head { display: flex; gap: 0.6rem; }
.day-head { font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #4338ca; margin: 0.5rem 0 0.15rem; }
.stop-type { flex: 0 0 26px; height: 26px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; cursor: pointer; font-size: 0.8rem; padding: 0; }
.stop-type:hover { border-color: #6366f1; }
.overnight { margin: 0.15rem 0 0.35rem 2rem; padding: 0.4rem 0.5rem; border-radius: 8px; background: #f5f3ff; border: 1px solid #ede9fe; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; }
.on-row { display: flex; align-items: center; gap: 0.35rem; }
.on-row a { text-decoration: none; color: #4f46e5; font-weight: 700; }
.on-nights { width: 3.2rem; font: inherit; padding: 1px 4px; border: 1px solid var(--border-color); border-radius: 4px; }
.on-until { color: #6b7280; }
.on-input { flex: 1; min-width: 0; font: inherit; padding: 0.2rem 0.4rem; border: 1px solid var(--border-color); border-radius: 5px; background: #fff; }
.on-price { flex: 0 0 6rem; }
.on-cur { font: inherit; padding: 0.15rem; border: 1px solid var(--border-color); border-radius: 5px; background: #fff; }
.wp-trip { font-weight: 600; margin-bottom: 0.2rem; }

.stops-hint { font-size: 0.75rem; color: #4338ca; background: #eef2ff; border-radius: 6px; padding: 0.35rem 0.5rem; margin-bottom: 0.4rem; }
.stop-type { font-size: 1rem; }

/* ===== picked places at a stop ===== */
.spots { margin: 0.15rem 0 0.35rem 2.2rem; display: flex; flex-direction: column; gap: 0.15rem; }
.spot-row { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; }
.spot-name { flex: 1; text-align: left; background: none; border: none; padding: 0; cursor: pointer; color: var(--text-primary, #1f2937); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-name:hover { color: #4338ca; }
.spot-row a { text-decoration: none; font-size: 0.75rem; }
.spot-cost { width: 52px; font-size: 0.75rem; padding: 0.1rem 0.25rem; border: 1px solid var(--border-color); border-radius: 4px; }
.spots-open { align-self: flex-start; font-size: 0.78rem; }
.spot-marker { width: 22px; height: 22px; border-radius: 50%; background: #fef3c7; border: 2px solid #f59e0b; display: flex; align-items: center; justify-content: center; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.booked-chk { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.75rem; color: var(--text-secondary, #4b5563); white-space: nowrap; }
.leg-money { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0.2rem 0 0.2rem 1.6rem; font-size: 0.8rem; }
.leg-money .leg-ref { flex: 1 1 120px; }

/* ===== "Popular here" panel ===== */
.popular-panel { position: fixed; top: 80px; right: 14px; width: 390px; max-width: calc(100vw - 28px); max-height: calc(100vh - 100px); z-index: 1500;
    background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: none; flex-direction: column; overflow: hidden; }
.pp-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.75rem 0.9rem 0.4rem; border-bottom: 1px solid var(--border-color); }
.pp-title { font-weight: 700; font-size: 1rem; }
.pp-sub { font-size: 0.75rem; color: var(--text-muted, #6b7280); }
.pp-close { border: none; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: #6b7280; }
.pp-filters { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.45rem 0.9rem; border-bottom: 1px solid var(--border-color); }
.pp-cat { border: 1px solid var(--border-color); background: #fff; border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.75rem; cursor: pointer; }
.pp-cat.on { background: #eef2ff; border-color: #a5b4fc; color: #4338ca; }
.pp-radius { font-size: 0.75rem; margin-left: auto; }
.pp-body { overflow-y: auto; padding: 0.4rem 0.6rem 0.8rem; }
.pp-msg { padding: 1rem; color: var(--text-muted, #6b7280); font-size: 0.85rem; }
.pp-msg.err, .pp-note.err { color: #b91c1c; }
.pp-section { margin-top: 0.4rem; }
.pp-sec-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.85rem; padding: 0.3rem 0.3rem; }
.pp-note { font-size: 0.7rem; color: var(--text-muted, #6b7280); font-weight: 400; }
.pp-empty { font-size: 0.8rem; color: var(--text-muted, #6b7280); padding: 0.2rem 0.3rem 0.5rem; }
.pp-item { display: flex; gap: 0.55rem; padding: 0.45rem 0.3rem; border-radius: 8px; align-items: flex-start; }
.pp-item.hl { background: #f5f7ff; }
.pp-item.added { background: #ecfdf5; }
.pp-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: 0 0 64px; background: #f3f4f6; }
.pp-nophoto { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.pp-info { flex: 1; min-width: 0; }
.pp-name { font-weight: 600; font-size: 0.85rem; }
.pp-score { font-size: 0.7rem; background: #eef2ff; color: #4338ca; border-radius: 4px; padding: 0 0.25rem; font-weight: 600; cursor: help; }
.pp-desc { font-size: 0.75rem; color: var(--text-secondary, #4b5563); }
.pp-meta { font-size: 0.7rem; color: var(--text-muted, #6b7280); margin-top: 0.1rem; }
.pp-meta a { color: #4338ca; }
.pp-add { flex: 0 0 30px; height: 30px; border-radius: 50%; border: 1px solid #a5b4fc; background: #fff; color: #4338ca; font-size: 1.1rem; cursor: pointer; }
.pp-item.added .pp-add { background: #10b981; border-color: #10b981; color: #fff; }
.pp-marker { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; background: #6366f1; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.pp-marker.comm { background: #f59e0b; font-size: 12px; }
.pp-marker.new { width: 26px; height: 26px; background: #ef4444; }
.pp-share { display: flex; flex-direction: column; gap: 0.3rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 0.5rem; margin: 0 0.2rem 0.5rem; }
.pp-share textarea { resize: vertical; font-family: inherit; }
.pp-file { font-size: 0.75rem; max-width: 200px; }
.pp-where { font-size: 0.75rem; color: var(--text-secondary, #4b5563); }

/* ===== budget & bookings ===== */
.tb { margin-top: 0.5rem; border: 1px solid var(--border-color); border-radius: 8px; padding: 0.4rem 0.6rem; font-size: 0.82rem; background: #fcfcff; }
.tb summary { cursor: pointer; font-weight: 600; }
.tb-settings { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin: 0.5rem 0; font-size: 0.78rem; align-items: center; }
.tb-num { width: 56px; padding: 0.1rem 0.25rem; border: 1px solid var(--border-color); border-radius: 4px; }
.tb-table { width: 100%; border-collapse: collapse; }
.tb-table td { padding: 0.15rem 0; border-bottom: 1px dashed #e5e7eb; }
.tb-amt { text-align: right; white-space: nowrap; }
.tb-total td { font-weight: 700; border-bottom: none; padding-top: 0.3rem; }
.tb-note { font-size: 0.7rem; color: var(--text-muted, #6b7280); margin-top: 0.2rem; }
.tb-sub { font-weight: 600; margin: 0.6rem 0 0.25rem; }
.tb-extra { display: flex; gap: 0.25rem; align-items: center; margin-bottom: 0.2rem; }
.tb-extra .on-input:first-child { flex: 1; }
.tb-book { display: flex; gap: 0.35rem; align-items: center; padding: 0.1rem 0; cursor: pointer; }
.tb-book.done span { color: #059669; }
.tb-book a { text-decoration: none; }

/* ===== AI review ===== */
.tb.ai { background: #faf5ff; }
.ai-wishes { width: 100%; margin: 0.4rem 0; resize: vertical; font-size: 0.8rem; box-sizing: border-box; }
.ai-go { margin-bottom: 0.4rem; }
.ai-out { font-size: 0.82rem; line-height: 1.4; margin-top: 0.3rem; }
.ai-out .ai-h { font-weight: 700; margin: 0.6rem 0 0.2rem; color: #6d28d9; }
.ai-out p { margin: 0.2rem 0; }
.ai-out ul, .ai-out ol { margin: 0.2rem 0 0.2rem 1.1rem; padding: 0; }
.ai-out li { margin: 0.1rem 0; }

.ai-edit { margin-top: 0.4rem; border-top: 1px dashed #ddd6fe; }
.ai-prop { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.3rem; }
.ai-sum { font-size: 0.8rem; font-style: italic; }
.ai-ch { display: flex; gap: 0.4rem; align-items: flex-start; font-size: 0.8rem; cursor: pointer; background: #fff; border: 1px solid #ede9fe; border-radius: 6px; padding: 0.3rem 0.4rem; }
.ai-ch.bad { opacity: 0.6; cursor: default; }
.ai-ch > span { display: flex; flex-direction: column; gap: 0.1rem; }
.ai-why { color: var(--text-secondary, #4b5563); font-size: 0.75rem; }
.ai-found { color: var(--text-muted, #6b7280); font-size: 0.7rem; }
.ai-warn { color: #b45309; font-size: 0.72rem; }

.poi-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: 0 0 52px; background: #f3f4f6; }
.poi-desc { display: block; color: var(--text-secondary, #4b5563); white-space: normal; }
.poi-cats-note { grid-column: 1 / -1; width: 100%; font-size: 0.72rem; color: var(--text-muted, #6b7280); margin-bottom: 0.2rem; }

.leg-spots { margin: 0.1rem 0 0.25rem 1.6rem; }
.leg-spots .spot-name { color: #0f766e; }
.leg-spots .spot-name small { color: var(--text-muted, #6b7280); }
.leg-spots-sum { font-size: 0.7rem; color: var(--text-muted, #6b7280); }
.spot-marker.on-way { background: #ccfbf1; border-color: #0d9488; color: #0f766e; width: 20px; height: 20px; font-size: 10px; }
.poi-as-stop { border: none; background: none; color: var(--text-muted, #6b7280); font-size: 0.75rem; cursor: pointer; text-decoration: underline; }
.poi-add.added { background: #10b981; }

.spot-around { font-size: 0.7rem; }
.wiki-tooltip { padding: 0; border-radius: 8px; pointer-events: none !important; }
.wtip { display: flex; flex-direction: column; width: 200px; white-space: normal; }
.wtip img { width: 200px; height: 120px; object-fit: cover; border-radius: 8px 8px 0 0; }
.wtip b { padding: 4px 8px 0; }
.wtip small { padding: 0 8px 6px; color: #6b7280; }
.wiki-card { margin-top: 6px; font-size: 0.8rem; }
.wiki-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 6px; }
.wiki-text { margin: 4px 0; color: #374151; }
.wiki-none { color: #9ca3af; font-size: 0.75rem; }

.tb-book { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: center; justify-content: space-between; padding: 0.15rem 0; }
.tb-book label { display: flex; gap: 0.35rem; align-items: center; cursor: pointer; }
.tb-book small { color: var(--text-muted, #6b7280); }
.tb-find { display: inline-flex; gap: 0.5rem; font-size: 0.78rem; }
.tb-find a { text-decoration: none; padding: 0.05rem 0.4rem; border-radius: 4px; border: 1px solid #c7d2fe; color: #4338ca; white-space: nowrap; }
.tb-find a.find-booking { background: #003580; border-color: #003580; color: #fff; }
.tb-prefs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: center; font-size: 0.78rem; color: var(--text-secondary, #4b5563); margin-bottom: 0.3rem; }
.tb-prefs .tb-num { width: 44px; } .tb-prefs .ages { width: 64px; }

.on-find, .dv-find { font-size: 0.72rem; white-space: nowrap; color: #003580; }

.tb-book-name { flex: 1 1 260px; }
.tb-book-money { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.78rem; }
.tb-book-money label { display: inline-flex; gap: 0.2rem; align-items: center; cursor: pointer; }
.tb-book-money .tb-price { width: 70px; }
.tb-book-money label.off, .booked-chk.off { opacity: 0.45; cursor: not-allowed; }
.tb-book.paid .tb-book-name { color: #059669; }
.tb-book.done:not(.paid) .tb-book-name { color: #b45309; }

/* weather on map cards (Open-Meteo) */
.wtip-wx { padding: 2px 8px 6px; font-size: 0.8rem; color: #374151; }
.wtip .wtip-wx { padding-top: 0; }
.wtip-wx .wx-src, .wtip .wtip-wx .wx-src { padding: 0; color: #9ca3af; font-size: 0.7rem; }
.wiki-wx { margin-bottom: 6px; }
.wiki-wx .wtip-wx { padding: 0; }
.wx { white-space: nowrap; }
.wx-usual { color: #4b5563; }
.wx-attr { display: inline-block; font-size: 0.7rem; color: #9ca3af !important; }

/* ---------- auth: forgot password, account pages, security block ---------- */
.auth-forgot-link { background: none; border: none; color: var(--primary-color, #2563eb); cursor: pointer;
    font-size: 0.85rem; align-self: flex-end; padding: 0; margin-top: -0.25rem; }
.auth-forgot-link:hover { text-decoration: underline; }
.form-hint { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: #6b7280; }
.auth-done { padding: 0.75rem; border-radius: 8px; background: #ecfdf5; color: #065f46; font-size: 0.9rem; }
.account-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f3f4f6; }
.account-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 1rem; }
.account-card h2 { margin: 0 0 0.5rem; font-size: 1.3rem; }
.account-brand { font-weight: 700; color: var(--primary-color, #2563eb); text-decoration: none; font-size: 1.1rem; }
.account-msg { padding: 0.75rem; border-radius: 8px; font-size: 0.9rem; }
.account-msg.ok { background: #ecfdf5; color: #065f46; }
.account-msg.err { background: #fef2f2; color: #991b1b; }
.sec-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6; flex-wrap: wrap; }
.sec-badge { display: inline-block; margin-left: 0.5rem; font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 999px; }
.sec-badge.ok { background: #ecfdf5; color: #065f46; }
.sec-badge.warn { background: #fffbeb; color: #92400e; }
.sec-form { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0; max-width: 360px; }
