.tn-map-layout .tn-navwrap { min-height: 54px; }
.tn-map-layout .tn-brand img { height: 20px; }
.tn-map-layout .tn-nav { gap: 31px; font-size: 12px; }
.tn-map-layout .tn-nav-link { font-size: 12px; }
.tn-map-layout .tn-icon-link { width: 32px; height: 32px; font-size: 17px; }
.tn-map-layout .tn-user-menu__button { min-height: 42px; }

.tn-map-page {
    --map-blue: #105cf6;
    --map-navy: #081b4f;
    --map-muted: #62718e;
    --map-line: #dce5f2;
    min-height: 100vh;
    color: var(--map-navy);
    background: linear-gradient(180deg, #f8fbff 0, #fff 78%);
}

.tn-map-page .tn-shell { width: min(1320px, calc(100% - 48px)); }
.tn-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.tn-map-hero {
    min-height: 112px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(242,249,255,.98) 0%, rgba(242,249,255,.88) 45%, rgba(232,246,255,.74) 100%),
        url('/images/all-places-hero.png') center 58% / cover;
    border-bottom: 1px solid #e4edf7;
}

.tn-map-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 34px; background: linear-gradient(0deg, rgba(225,242,253,.65), transparent); pointer-events: none; }
.tn-map-hero__inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.tn-map-breadcrumbs { display: flex; gap: 10px; margin-bottom: 7px; color: #536582; font-size: 12px; font-weight: 700; }
.tn-map-breadcrumbs a { color: #314e7b; }
.tn-map-hero h1 { margin: 0 0 4px; color: var(--map-navy); font-size: clamp(28px, 2.5vw, 36px); line-height: 1; letter-spacing: -.045em; }
.tn-map-hero p { margin: 0; color: #4e6284; font-size: 13px; font-weight: 500; }
.tn-map-total { display: flex; align-items: center; gap: 12px; padding-right: 30px; font-size: 15px; }
.tn-map-total i { color: var(--map-blue); font-size: 24px; }

.tn-map-content { padding-top: 12px; padding-bottom: 54px; }
.tn-map-controls {
    position: relative;
    display: grid;
    grid-template-columns: minmax(320px, 2.7fr) minmax(145px, 1fr) minmax(145px, 1fr) auto 196px auto;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid var(--map-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(20,48,88,.035);
}

.tn-map-search { position: relative; display: block; }
.tn-map-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #536d98; font-size: 14px; pointer-events: none; }
.tn-map-search input,
.tn-map-select select,
.tn-map-more-filters select,
.tn-map-results-header select {
    width: 100%; height: 36px; padding: 0 34px 0 13px;
    border: 1px solid #d6e0ee; border-radius: 8px; outline: 0; background: #fff;
    color: #223b68; font: 600 12px/1 Inter, sans-serif;
}
.tn-map-search input { padding-left: 38px; }
.tn-map-search input::placeholder { color: #6b7994; opacity: 1; }
.tn-map-search input:focus,
.tn-map-select select:focus,
.tn-map-more-filters select:focus { border-color: #83a9ff; box-shadow: 0 0 0 3px rgba(16,92,246,.1); }
.tn-map-filter-button,
.tn-map-clear,
.tn-map-view-switch button {
    height: 36px; border-radius: 8px; font: 800 11px/1 Inter, sans-serif; cursor: pointer;
}
.tn-map-filter-button { display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; border: 1px solid #d6e0ee; background: #fff; color: #314a75; white-space: nowrap; }
.tn-map-filter-button i { color: #244d92; }
.tn-map-view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 2px; border: 1px solid #d6e0ee; border-radius: 9px; background: #f9fbff; }
.tn-map-view-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; color: #4e6386; }
.tn-map-view-switch button.is-active { background: linear-gradient(180deg, #1769ff, #0953e8); color: #fff; box-shadow: 0 3px 8px rgba(16,92,246,.22); }
.tn-map-clear { display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid #d6e0ee; color: #32496e; background: #f9fbfe; }
.tn-map-more-filters { position: absolute; z-index: 1002; top: calc(100% + 7px); right: 286px; width: 350px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; border: 1px solid var(--map-line); border-radius: 11px; background: #fff; box-shadow: 0 16px 35px rgba(12,40,83,.16); }
.tn-map-more-filters[hidden] { display: none; }
.tn-map-more-filters label > span { display: block; margin: 0 0 7px; color: #4c5f80; font-size: 11px; font-weight: 800; }

.tn-map-quick-filters { display: flex; gap: 7px; padding: 6px 0 10px; overflow-x: auto; scrollbar-width: thin; }
.tn-map-quick-filters button { flex: 0 0 auto; height: 38px; padding: 0 17px; border: 1px solid #dce5f2; border-radius: 9px; background: #f8fbff; color: #31486f; font: 700 11px/1 Inter, sans-serif; cursor: pointer; }
.tn-map-quick-filters button i { margin-right: 9px; color: #405a82; font-size: 13px; }
.tn-map-quick-filters button.is-active { border-color: var(--map-blue); background: linear-gradient(180deg,#196aff,#0c57ee); color: #fff; box-shadow: 0 5px 12px rgba(16,92,246,.18); }
.tn-map-quick-filters button.is-active i { color: #fff; }

.tn-map-explorer {
    display: grid;
    grid-template-columns: 405px minmax(0,1fr);
    height: 610px;
    border: 1px solid #d9e4f1;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 5px 18px rgba(24,54,94,.04);
}
.tn-map-results-panel { min-width: 0; display: flex; flex-direction: column; padding: 10px 10px 11px; border-right: 1px solid #dce6f2; background: #fff; }
.tn-map-results-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 1px 4px 10px; }
.tn-map-results-header h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.025em; }
.tn-map-results-header p { margin: 0; color: #657694; font-size: 11px; font-weight: 600; }
.tn-map-results-header label { width: 128px; flex: 0 0 128px; }
.tn-map-results-header select { height: 32px; font-size: 10px; }
.tn-map-results { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #ccd9ec transparent; }
.tn-map-card { position: relative; flex: 0 0 auto; display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 12px; min-height: 100px; padding: 9px; border: 1px solid #dbe5f2; border-radius: 10px; color: var(--map-navy); background: #fff; transition: border-color .18s, box-shadow .18s, background .18s; cursor: pointer; }
.tn-map-card:hover { border-color: #a9c3f6; box-shadow: 0 5px 14px rgba(20,60,120,.08); }
.tn-map-card.is-selected { border: 2px solid var(--map-blue); padding: 8px; background: #f8fbff; box-shadow: 0 5px 15px rgba(16,92,246,.1); }
.tn-map-card__image { width: 92px; height: 82px; object-fit: cover; border-radius: 7px; background: linear-gradient(135deg,#c4e8f6,#e3f0dc); }
.tn-map-card__placeholder { display: grid; place-items: center; color: #fff; font-size: 22px; }
.tn-map-card__body { min-width: 0; display: flex; flex-direction: column; }
.tn-map-card__title { display: flex; align-items: center; gap: 7px; padding-right: 49px; }
.tn-map-card__title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tn-map-card__type { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: #e5f5ff; color: #1471d8; font-size: 9px; font-weight: 800; }
.tn-map-card__save { position: absolute; top: 11px; right: 10px; border: 0; padding: 0; color: #56729d; background: none; font-size: 11px; font-weight: 700; cursor: pointer; }
.tn-map-card__save i { margin-right: 4px; font-size: 15px; }
.tn-map-card__save.is-saved { color: var(--map-blue); }
.tn-map-card__location { display: block; margin: 7px 0 5px; color: #61708b; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-map-card__location i { margin-right: 6px; color: #526d99; }
.tn-map-card__summary { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; color: #52627e; font-size: 10px; line-height: 1.45; }
.tn-map-card__link { align-self: flex-end; margin-top: auto; color: #0758e8; font-size: 10px; font-weight: 900; }
.tn-map-card__link i { margin-left: 5px; }
.tn-map-view-all { flex: 0 0 auto; height: 40px; margin-top: 8px; border: 1px solid #d6e2f1; border-radius: 8px; color: #0759eb; background: #f7faff; font: 850 11px/1 Inter, sans-serif; cursor: pointer; }
.tn-map-empty { margin: auto 20px; text-align: center; color: #61718c; }
.tn-map-empty i { display: block; margin-bottom: 12px; color: #9cb2d5; font-size: 30px; }
.tn-map-empty strong { display: block; margin-bottom: 5px; color: var(--map-navy); }

.tn-map-stage { position: relative; min-width: 0; height: 100%; padding: 5px 5px 48px; background: #eef5fb; }
.tn-map-canvas { width: 100%; height: 100%; min-height: 0; border-radius: 9px 9px 0 0; background: #d8edf7; z-index: 0; }
.tn-map-canvas .leaflet-control-zoom { border: 0; box-shadow: 0 2px 7px rgba(10,37,73,.24); }
.tn-map-canvas .leaflet-control-zoom a { width: 32px; height: 32px; line-height: 31px; color: #18345f; border-color: #e1e7f0; font-size: 19px; }
.tn-map-canvas .leaflet-control-attribution { font-size: 9px; }
.tn-map-canvas .leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 10px 26px rgba(10,37,73,.24); }
.tn-map-canvas .leaflet-popup-content { width: 224px !important; margin: 9px; }
.tn-map-canvas .leaflet-popup-close-button { top: 4px; right: 4px; color: #6d7e97; }
.tn-map-popup { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 10px; color: var(--map-navy); font-family: Inter, sans-serif; }
.tn-map-popup__image { width: 64px; height: 64px; object-fit: cover; border-radius: 7px; background: #dceaf3; }
.tn-map-popup__content { min-width: 0; }
.tn-map-popup__head { display: flex; align-items: center; gap: 6px; padding-right: 10px; }
.tn-map-popup__head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tn-map-popup__head em { padding: 3px 6px; border-radius: 999px; background: #e3f4ff; color: #0870db; font-size: 8px; font-style: normal; font-weight: 800; }
.tn-map-popup small { display: block; margin: 5px 0; color: #65738c; font-size: 9px; }
.tn-map-popup p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; color: #53627b; font-size: 9px; line-height: 1.35; }
.tn-map-popup__actions { grid-column: 1 / -1; display: flex; gap: 7px; }
.tn-map-popup__actions a,
.tn-map-popup__actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; height: 25px; border-radius: 6px; font: 800 9px/1 Inter, sans-serif; }
.tn-map-popup__actions a { background: var(--map-blue); color: #fff; }
.tn-map-popup__actions button { border: 1px solid #cfdaea; background: #fff; color: #26416d; cursor: pointer; }

.tn-place-marker-wrapper { background: transparent; border: 0; }
.tn-place-marker { position: relative; width: 24px; height: 31px; filter: drop-shadow(0 3px 3px rgba(14,58,95,.28)); transform-origin: 50% 100%; transition: transform .15s; }
.tn-place-marker::before { content: ""; position: absolute; left: 3px; top: 2px; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #00a6bd; transform: rotate(-45deg); }
.tn-place-marker::after { content: ""; position: absolute; left: 10px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.tn-place-marker.is-selected { transform: scale(1.28); }
.tn-place-marker.is-selected::before { background: #ff4a4f; }
.tn-marker-cluster { display: grid !important; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #1565f5; color: #fff; box-shadow: 0 4px 10px rgba(15,79,201,.34); font: 900 11px/1 Inter, sans-serif; }
.tn-marker-cluster span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.18); }

.tn-map-floating-controls { position: absolute; z-index: 500; top: 14px; right: 14px; display: flex; gap: 8px; }
.tn-map-floating-controls > button,
.tn-map-move-search { height: 34px; border: 1px solid #d7e0ec; border-radius: 7px; background: rgba(255,255,255,.96); box-shadow: 0 2px 7px rgba(10,38,75,.12); }
.tn-map-floating-controls > button { width: 34px; color: #1c3d6b; cursor: pointer; }
.tn-map-move-search { display: flex; align-items: center; gap: 7px; padding: 0 10px; color: #263c61; font-size: 9px; font-weight: 800; cursor: pointer; }
.tn-map-move-search input { position: absolute; opacity: 0; pointer-events: none; }
.tn-map-move-search span { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid #aac0e1; border-radius: 4px; color: transparent; background: #fff; }
.tn-map-move-search input:checked + span { border-color: var(--map-blue); color: #fff; background: var(--map-blue); }
.tn-map-layer-menu { position: absolute; z-index: 501; top: 56px; right: 14px; width: 112px; padding: 5px; border: 1px solid #d7e0ec; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(10,38,75,.18); }
.tn-map-layer-menu[hidden] { display: none; }
.tn-map-layer-menu button { width: 100%; padding: 8px 9px; border: 0; border-radius: 5px; text-align: left; color: #324d77; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.tn-map-layer-menu button.is-active { color: #0759eb; background: #eef4ff; }
.tn-map-legend { position: absolute; z-index: 450; right: 14px; bottom: 60px; display: flex; gap: 12px; height: 32px; align-items: center; padding: 0 10px; border: 1px solid #d5dfeb; border-radius: 7px; color: #334c73; background: rgba(255,255,255,.94); font-size: 9px; font-weight: 700; }
.tn-map-legend span { display: flex; align-items: center; gap: 6px; }
.tn-map-legend i { width: 10px; height: 14px; border-radius: 50% 50% 50% 0; background: #00a6bd; transform: rotate(-45deg); }
.tn-map-legend b { width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: #1565f5; box-shadow: 0 0 0 1px #bad0ff; }
.tn-map-stage-footer { position: absolute; left: 5px; right: 5px; bottom: 5px; height: 43px; display: flex; align-items: center; gap: 22px; padding: 0 14px; border-radius: 0 0 9px 9px; color: #60718e; background: #f8fbff; font-size: 9px; font-weight: 650; }
.tn-map-stage-footer > span { flex: 1; }
.tn-map-stage-footer > span i { margin-right: 7px; color: #607496; font-size: 14px; vertical-align: middle; }
.tn-map-stage-footer button { height: 29px; padding: 0 13px; border: 1px solid #d6e1ef; border-radius: 6px; color: #0b5ce9; background: #fff; font: 800 9px/1 Inter, sans-serif; cursor: pointer; }
.tn-map-stage-footer label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.tn-map-stage-footer label input { position: absolute; opacity: 0; }
.tn-map-stage-footer label span { position: relative; width: 34px; height: 19px; border-radius: 999px; background: #c6d2e5; transition: background .15s; }
.tn-map-stage-footer label span::after { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tn-map-stage-footer label input:checked + span { background: var(--map-blue); }
.tn-map-stage-footer label input:checked + span::after { transform: translateX(15px); }
.tn-map-stage:fullscreen { padding: 6px 6px 48px; background: #eef5fb; }
.tn-map-stage:fullscreen .tn-map-canvas { height: 100%; }

.tn-map-explorer.is-list-view { display: block; height: auto; min-height: 540px; }
.tn-map-explorer.is-list-view .tn-map-results-panel { min-height: 540px; border-right: 0; }
.tn-map-explorer.is-list-view .tn-map-results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; overflow: visible; }
.tn-map-explorer.is-list-view .tn-map-stage { display: none; }
.tn-map-explorer.is-list-view .tn-map-view-all { max-width: 380px; width: 100%; align-self: center; }

.tn-map-collections { padding-top: 18px; }
.tn-map-collections > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tn-map-collections h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.tn-map-collections header a { color: #0759eb; font-size: 10px; font-weight: 850; }
.tn-map-collections header a i { margin-left: 5px; }
.tn-map-collection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.tn-map-collection { position: relative; display: flex; align-items: flex-end; height: 95px; overflow: hidden; border-radius: 8px; color: #fff; background-position: center; background-size: cover; box-shadow: inset 0 -50px 55px rgba(2,22,54,.62); }
.tn-map-collection::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,30,66,.55), transparent 70%); transition: background .2s; }
.tn-map-collection:hover::after { background: linear-gradient(90deg, rgba(5,58,140,.7), rgba(5,58,140,.08)); }
.tn-map-collection--islands { background-image: url('/images/places-footer-banner.png'); }
.tn-map-collection--cities { background-image: url('/images/all-places-hero.png'); }
.tn-map-collection--parks { background-image: url('/images/about-thailand-project.png'); }
.tn-map-collection > span { position: relative; z-index: 1; display: grid; grid-template-columns: 28px 1fr; padding: 0 18px 12px; }
.tn-map-collection > span i { grid-row: 1 / 3; align-self: center; font-size: 22px; }
.tn-map-collection strong { font-size: 14px; }
.tn-map-collection small { margin-top: 2px; font-size: 10px; font-weight: 650; }
.tn-map-notice { padding: 20px; color: #725500; background: #fff5ce; }

@media (max-width: 1120px) {
    .tn-map-layout .tn-nav { gap: 15px; }
    .tn-map-controls { grid-template-columns: minmax(260px,2fr) 1fr 1fr auto; }
    .tn-map-view-switch { grid-column: 1 / 3; }
    .tn-map-clear { grid-column: 4; grid-row: 2; }
    .tn-map-more-filters { right: 0; }
    .tn-map-explorer { grid-template-columns: 350px minmax(0,1fr); }
    .tn-map-stage-footer { gap: 10px; }
}

@media (max-width: 820px) {
    .tn-map-page .tn-shell { width: min(100% - 28px, 1320px); }
    .tn-map-hero__inner { align-items: flex-end; }
    .tn-map-total { padding-right: 0; padding-bottom: 3px; font-size: 12px; }
    .tn-map-controls { grid-template-columns: 1fr 1fr; }
    .tn-map-search { grid-column: 1 / -1; }
    .tn-map-filter-button { justify-content: center; }
    .tn-map-view-switch { grid-column: 1; }
    .tn-map-clear { grid-column: 2; grid-row: auto; }
    .tn-map-more-filters { left: 0; right: 0; width: auto; }
    .tn-map-explorer { display: flex; height: auto; flex-direction: column-reverse; overflow: visible; }
    .tn-map-results-panel { min-height: 520px; border-top: 1px solid #dce6f2; border-right: 0; }
    .tn-map-stage { height: 500px; flex: 0 0 auto; }
    .tn-map-explorer.is-list-view .tn-map-results { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 560px) {
    .tn-map-layout .tn-navwrap { min-height: 60px; }
    .tn-map-hero { min-height: 132px; }
    .tn-map-hero__inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 12px; }
    .tn-map-hero h1 { font-size: 29px; }
    .tn-map-total { position: absolute; right: 0; top: 7px; }
    .tn-map-total i { font-size: 18px; }
    .tn-map-controls { grid-template-columns: 1fr; }
    .tn-map-search,.tn-map-view-switch,.tn-map-clear { grid-column: 1; }
    .tn-map-more-filters { grid-template-columns: 1fr; }
    .tn-map-quick-filters { margin-right: -14px; }
    .tn-map-stage { height: 455px; padding-bottom: 6px; }
    .tn-map-stage-footer { display: none; }
    .tn-map-floating-controls { left: 51px; right: 9px; }
    .tn-map-floating-controls > button { margin-left: auto; }
    .tn-map-floating-controls > button + button { margin-left: 0; }
    .tn-map-legend { bottom: 14px; right: 10px; }
    .tn-map-results-header { align-items: flex-start; }
    .tn-map-results-header label { width: 118px; flex-basis: 118px; }
    .tn-map-card { grid-template-columns: 82px minmax(0,1fr); }
    .tn-map-card__image { width: 82px; }
    .tn-map-explorer.is-list-view .tn-map-results { grid-template-columns: 1fr; }
    .tn-map-collection-grid { grid-template-columns: 1fr; }
    .tn-map-collection { height: 105px; }
}
