:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #ffa07a;
    --bg-color: #fff5f7;
    --card-bg: #ffffff;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --border-color: #dfe6e9;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe8f0 100%);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    position: relative;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
}

.edit-mode-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.edit-mode-btn.active {
    background: white;
    color: var(--primary-color);
}

/* Filter Navigation */
.filter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

.share-btn,
.download-btn {
    padding: 12px 24px;
    background: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.share-btn:hover,
.download-btn:hover {
    background: #ff8c5a;
    border-color: #ff8c5a;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Map Container */
.map-container {
    position: relative;
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 700px;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

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

.marker-icon {
    font-size: 1.5rem;
}

/* Info Panel */
.info-panel {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 700px;
}

.tabs {
    display: flex;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 107, 157, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* Tab Header */
.tab-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.tab-header .search-box {
    flex: 1;
    margin: 0;
}

.selection-counter {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.add-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

/* Item List */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px;
}

.day-section {
    padding: 15px 0;
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
}

.day-section:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.day-section h4 {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--primary-color);
}

.item-card {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
}

.item-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.item-card.hidden {
    display: none;
}

.item-card.selected {
    background: linear-gradient(135deg, #ffe8f0 0%, #fff5f7 100%);
    border-left-color: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.select-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: none;
    transition: all 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.edit-mode .delete-btn {
    display: block;
}

.item-card h3 {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin: 0;
    flex-grow: 1;
}

.item-card .category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.item-card .details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.item-card .details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-card .description {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.item-card .rating {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.item-card .links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.item-card .links a {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.item-card .links a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-dark);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: -10px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #b2bec3;
}

/* Route Plan */
.route-plan h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.day-route {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.day-route h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.route-item {
    display: flex;
    align-items: start;
    gap: 15px;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--primary-color);
}

.route-time {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
}

.route-details {
    flex: 1;
}

.route-details strong {
    color: var(--text-dark);
}

.route-details p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

footer p {
    color: var(--text-light);
    margin-bottom: 5px;
}

.note {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 500px;
    }

    .info-panel {
        height: auto;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .edit-mode-btn {
        position: static;
        margin-top: 15px;
    }

    .filter-nav {
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .map-legend {
        top: 10px;
        right: 10px;
        padding: 10px;
        font-size: 0.8rem;
    }

    .item-card {
        padding: 15px;
    }

    .tab-header {
        flex-direction: column;
    }

    .tab-header .search-box {
        margin-bottom: 10px;
    }
}

/* Date Selector Styles */
.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.date-select {
    padding: 8px 12px;
    border: 1.5px solid var(--primary-color);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.date-select:hover {
    border-color: var(--secondary-color);
    background: var(--bg-color);
}

.date-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

/* ===== View Page: Places & Reviews ===== */

.back-bar {
    padding: 10px;
    background: var(--bg-color);
    border-bottom: 1px solid #ffe8f0;
}

.back-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
}

.overview-panel {
    background: var(--card-bg);
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    max-height: none;
}

.overview-title {
    margin-bottom: 16px;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.overview-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #ffe0ed;
    min-height: 74px;
}

.overview-label {
    font-size: 0.77rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.overview-value {
    font-size: 1.22rem;
    color: var(--primary-color);
    font-weight: 700;
}

.overview-filter {
    margin-bottom: 16px;
}

.overview-filter-title {
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.overview-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.overview-filter-btn {
    border: 1px solid #e8b3c8;
    background: #fff;
    color: var(--text-dark);
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-height: 44px;
}

.overview-filter-btn:hover {
    background: #ffe3f0;
}

.overview-filter-btn.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.overview-help {
    background: #ecf5ff;
    border: 1px solid #cfe2f3;
    border-radius: 12px;
    padding: 12px;
}

.overview-help-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1e4f9f;
}

.overview-help p {
    font-size: 0.82rem;
    color: #2a5b96;
    margin: 0;
}

.map-section {
    margin-bottom: 30px;
}

.places-section {
    margin-bottom: 30px;
}

.weather-widget {
    margin-bottom: 18px;
}

.secondary-panel {
    background: transparent;
    margin-bottom: 18px;
}

.secondary-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 12px;
}

.secondary-panel-title-wrap {
    min-width: 0;
}

.secondary-panel-body[hidden] {
    display: none !important;
}

.mobile-section-toggle {
    display: none;
    min-height: 42px;
    border: 1px solid #f1c0d3;
    border-radius: 999px;
    background: #fff;
    color: var(--text-dark);
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.mobile-section-toggle:hover {
    background: #fff0f6;
}

.trip-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 20px;
    background: linear-gradient(135deg, #fff 0%, #fff7fa 56%, #ffe7f0 100%);
    border: 1px solid #ffd5e3;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.trip-insights {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.trip-quick-glance {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trip-glance-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #f4d6e2;
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.trip-summary-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
}

.trip-summary-toggle {
    min-height: 42px;
    border: 1px solid #f1c0d3;
    border-radius: 999px;
    background: #fff;
    color: var(--text-dark);
    padding: 0 16px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.trip-summary-toggle:hover {
    background: #fff0f6;
}

.trip-summary-details {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
}

.trip-summary-details.is-collapsed {
    display: none;
}

.trip-insight-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #f4d6e2;
    border-radius: 16px;
    padding: 14px 16px;
}

.trip-insight-label {
    display: block;
    color: var(--text-light);
    font-size: 0.76rem;
    margin-bottom: 6px;
}

.trip-insight-value {
    display: block;
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.trip-insight-text {
    color: var(--text-light);
    font-size: 0.82rem;
    margin: 0;
}

.trip-summary-kicker,
.memory-highlights-kicker {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.trip-summary-title {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.trip-summary-text {
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 56ch;
}

.trip-summary-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.trip-summary-stat {
    background: white;
    border: 1px solid #f6dbe5;
    border-radius: 16px;
    padding: 14px;
}

.trip-summary-label {
    display: block;
    color: var(--text-light);
    font-size: 0.76rem;
    margin-bottom: 6px;
}

.trip-summary-value {
    color: var(--primary-color);
    font-size: 1.24rem;
}

.memory-highlights {
    margin-bottom: 22px;
}

.memory-highlights-head {
    margin-bottom: 12px;
}

.memory-highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.memory-highlight-card,
.memory-highlight-empty {
    background: white;
    border-radius: 18px;
    border: 1px solid #f2dce5;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.memory-highlight-empty {
    grid-column: 1 / -1;
    padding: 20px;
    color: var(--text-light);
}

.memory-highlight-image {
    width: 100%;
    height: 168px;
    object-fit: cover;
    display: block;
}

.memory-highlight-copy {
    padding: 16px;
}

.memory-highlight-type {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
}

.memory-highlight-copy h3 {
    font-size: 1.08rem;
    margin-bottom: 4px;
}

.memory-highlight-copy p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.memory-highlight-meta {
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 600;
}

.weather-widget .weather-summary {
    background: #e3f2fd;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid #c3ddff;
    box-shadow: var(--shadow);
    color: #1e4f9f;
}

.weather-widget .weather-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
}

.weather-day {
    min-width: 115px;
    flex: 0 0 auto;
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.weather-day-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.weather-day-temp {
    font-weight: 700;
    color: #1e4f9f;
}

.places-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.places-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.place-sort-select {
    min-height: 44px;
    border: 1px solid #efbfd1;
    border-radius: 999px;
    background: white;
    color: var(--text-dark);
    padding: 0 16px;
    font-weight: 600;
}

.jump-unreviewed-btn {
    min-height: 44px;
    border: 1px solid #f1c0d3;
    background: #fff;
    color: var(--text-dark);
    border-radius: 999px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
}

.jump-unreviewed-btn:hover {
    background: #fff0f6;
}

.section-heading {
    color: var(--text-dark);
    font-size: 1.4rem;
    margin: 0;
}

.add-place-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-place-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.places-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.places-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Place Card */
.place-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid #f0f0f0;
}

.place-card--jump-target {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.18), var(--shadow);
}

.place-memory-preview {
    position: relative;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    background: #fff6fa;
    border: 1px solid #ffd7e5;
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 14px;
}

.place-memory-preview img {
    width: 92px;
    height: 92px;
    border-radius: 10px;
    object-fit: cover;
}

.place-memory-preview-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.place-memory-preview-label {
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: 700;
}

.place-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.place-name {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0;
}

.place-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.place-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.place-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.place-type-chip,
.place-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 700;
}

.place-type-chip {
    background: #f8f1ff;
    color: #7040a0;
}

.place-status-badge--pending {
    background: #fff1d6;
    color: #996515;
}

.place-status-badge--rating {
    background: #e8f0ff;
    color: #24539e;
}

.place-status-badge--complete {
    background: #e6f7ef;
    color: #1f7a45;
}

.place-area {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.place-description {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}

.place-review-summary {
    color: var(--text-light);
    font-size: 0.86rem;
    margin-bottom: 12px;
}

.place-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.place-map-link {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.place-map-link:hover {
    background: var(--secondary-color);
}

/* Reviews Section */
.reviews-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.reviews-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reviews-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reviews-empty {
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 10px 0;
}

.reviews-loading {
    font-size: 0.85rem;
    color: var(--text-light);
}

.reviews-error {
    font-size: 0.85rem;
    color: #dc3545;
}

/* Review Card */
.review-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 4px solid var(--primary-color);
}

.review-card.review-partner {
    border-left-color: var(--accent-color);
}

.review-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.review-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.review-date {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: auto;
}

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

/* Star Rating */
.star-rating {
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.star-rating .star {
    color: #ddd;
}

.star-rating .star.filled {
    color: #ffc107;
}

/* Star Picker */
.star-picker {
    display: flex;
    gap: 6px;
    font-size: 1.5rem;
    cursor: pointer;
}

.star-pick {
    color: #ddd;
    transition: color 0.15s;
}

.star-pick:hover,
.star-pick.active {
    color: #ffc107;
}

/* Review Photos */
.review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.review-photo-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.review-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.photo-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    line-height: 1;
}

/* Review Buttons */
.review-write-btn,
.review-edit-btn {
    padding: 8px 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.review-write-btn:hover,
.review-edit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.review-login-prompt {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 8px;
}

.review-login-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Review Modal */
.review-modal-content {
    max-width: 550px;
}

/* Photo Upload */
.photo-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.existing-photo {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
}

.existing-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    cursor: pointer;
    line-height: 1;
}

.photo-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.2s;
}

.photo-upload-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.photo-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.photo-preview-item {
    width: 70px;
    text-align: center;
}

.photo-preview-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.photo-name {
    font-size: 0.6rem;
    color: var(--text-light);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-size {
    font-size: 0.6rem;
    color: #28a745;
    display: block;
}

/* Viewer workspace UX */
.review-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    grid-template-areas:
        "map map"
        "overview places";
    gap: 24px;
    align-items: start;
    margin-bottom: 30px;
}

.review-workspace .map-section,
.review-workspace .overview-panel,
.review-workspace .places-section {
    transition: opacity 0.2s ease;
}

.review-workspace .map-section {
    grid-area: map;
    position: relative;
    top: auto;
    margin-bottom: 0;
}

.review-workspace .map-container {
    height: min(72vh, 780px);
    min-height: 48vh;
}

.review-workspace .overview-panel {
    grid-area: overview;
    margin-bottom: 0;
}

.review-workspace .places-section {
    grid-area: places;
    margin-bottom: 0;
    max-height: min(72vh, 820px);
    overflow-y: auto;
    padding-right: 4px;
}

.review-workspace [data-mobile-section][hidden] {
    display: none !important;
}

.review-workspace.mobile-mode [data-mobile-section].is-visible {
    display: block;
}

.add-place-btn,
.review-write-btn,
.review-edit-btn {
    min-height: 44px;
}

.review-workspace .places-list {
    gap: 14px;
}

.review-workspace .place-card {
    padding: 18px;
}

.mobile-overview-strip,
.mobile-place-filters {
    display: none;
}

.mobile-workspace-tabs {
    display: none;
    gap: 8px;
    margin: 0 0 12px;
}

.mobile-workspace-tab {
    flex: 1;
    min-height: 42px;
    border: 1px solid #efbfd1;
    background: white;
    border-radius: 999px;
    color: var(--text-dark);
    font-weight: 700;
}

.mobile-workspace-tab.is-active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mobile-map-toggle-btn {
    display: none;
    border: 1px solid #f1c0d3;
    background: #fff;
    color: var(--text-dark);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    min-height: 44px;
    cursor: pointer;
}

.mobile-map-toggle-btn:active {
    background: #ffe4ef;
}

.review-workspace .map-section .mobile-map-toggle-btn {
    margin-bottom: 8px;
}

@media (max-width: 1024px) {
    .trip-summary,
    .memory-highlights-grid,
    .trip-insights {
        grid-template-columns: 1fr;
    }

    .review-workspace {
        grid-template-columns: 1fr;
        grid-template-areas:
            "map"
            "overview"
            "places";
        gap: 16px;
    }

    .review-workspace .map-section {
        position: static;
    }

    .review-workspace .map-container {
        height: min(58vh, 560px);
    }

    .review-workspace .places-section {
        max-height: min(64vh, 760px);
        overflow-y: auto;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .mobile-workspace-tabs {
        display: flex;
    }

    .mobile-section-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .review-workspace {
        grid-template-columns: 1fr;
        grid-template-areas:
            "overview"
            "map"
            "places";
        gap: 12px;
    }

    .mobile-place-filters {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 0 10px;
        padding: 0 0 4px;
    }

    .mobile-place-filters::-webkit-scrollbar {
        display: none;
    }

    .mobile-place-filters .overview-filter-btn {
        flex: 1;
        min-width: 80px;
        padding: 8px 10px;
    }

    .mobile-map-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 112px;
    }

    .container {
        padding: 12px;
    }

    .review-workspace .map-section,
    .review-workspace .overview-panel,
    .review-workspace .places-section {
        margin-bottom: 0;
    }

    .overview-filter-actions {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        margin-bottom: 4px;
        gap: 6px;
    }

    .overview-filter-btn {
        min-width: 102px;
        justify-content: center;
        flex: 0 0 auto;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .overview-filter {
        margin-bottom: 12px;
    }

    .overview-help {
        padding: 9px 10px;
    }

    .overview-help-title {
        font-size: 0.76rem;
    }

    .overview-help p {
        font-size: 0.72rem;
        line-height: 1.35;
    }

    .review-workspace .places-list {
        gap: 12px;
    }

    .review-workspace .place-card {
        padding: 14px;
    }

    .place-card-header,
    .place-card .place-name,
    .review-card-header {
        font-size: 0.98rem;
    }

    .place-description,
    .review-text {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .place-area,
    .item-meta,
    .review-date {
        font-size: 0.74rem;
    }

    .add-place-btn,
    .review-write-btn,
    .review-edit-btn,
    .photo-upload-btn,
    .photo-remove-btn,
    .btn-primary,
    .btn-secondary,
    .close {
        min-height: 44px;
    }

    .review-workspace .map-container {
        min-height: 48vh;
        height: min(58vh, 620px);
    }

    .review-workspace .places-section {
        max-height: none;
        overflow-y: visible;
    }

    .places-header {
        gap: 8px;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .places-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .place-sort-select {
        flex: 1 1 100%;
    }

    .jump-unreviewed-btn {
        flex: 1 1 100%;
    }

    .places-header {
        margin-bottom: 12px;
    }

    .section-heading {
        font-size: 1.16rem;
    }

    .places-empty {
        padding: 20px 8px;
        font-size: 0.88rem;
    }

    .weather-widget {
        margin-bottom: 10px;
    }

    .weather-widget .weather-summary {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .trip-summary {
        padding: 16px;
        gap: 14px;
    }

    .secondary-panel {
        margin-bottom: 12px;
    }

    .secondary-panel-head {
        align-items: center;
        margin-bottom: 10px;
    }

    .trip-quick-glance {
        gap: 8px;
    }

    .trip-glance-chip {
        width: 100%;
        justify-content: flex-start;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .trip-summary-title {
        font-size: 1.3rem;
    }

    .memory-highlight-image {
        height: 148px;
    }

    .trip-summary-actions {
        width: 100%;
    }

    .trip-summary-toggle {
        width: 100%;
        justify-content: center;
    }

    .place-memory-preview {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .place-memory-preview img {
        width: 72px;
        height: 72px;
    }

    .place-chip-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .place-chip-row::-webkit-scrollbar {
        display: none;
    }

    .place-category,
    .place-type-chip,
    .place-status-badge {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .place-card-actions > * {
        width: 100%;
    }

    .place-map-link {
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }

    .review-card {
        padding: 12px;
    }

    .review-card-header {
        align-items: flex-start;
    }

    .review-date {
        width: 100%;
        margin-left: 0;
    }

    .weather-widget .weather-row {
        gap: 8px;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .weather-day {
        min-width: 98px;
        padding: 8px;
    }

    .weather-day-icon {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .weather-day-temp {
        font-size: 0.88rem;
    }
}

@media (max-width: 420px) {
    .review-workspace {
        gap: 12px;
    }

    .overview-panel,
    .places-section {
        border-radius: 12px;
    }

    .secondary-panel-head {
        flex-wrap: wrap;
    }

    .mobile-section-toggle {
        width: 100%;
    }

    .overview-panel {
        padding: 12px 12px;
    }

    .overview-title {
        font-size: 1.14rem;
        margin-bottom: 10px;
    }

    .overview-help {
        display: none;
    }

    .overview-filter {
        margin-bottom: 8px;
    }

    .overview-filter-title {
        font-size: 0.82rem;
    }

    .place-memory-preview {
        grid-template-columns: 1fr;
    }

    .place-memory-preview img {
        width: 100%;
        height: 180px;
    }

    .place-card {
        padding: 12px;
    }
}

@media (min-width: 1025px) {
    .review-workspace .overview-panel {
        position: sticky;
        top: 20px;
    }
}
