/* ==================================================
   LMTC — Building Rooms Directory
================================================== */

.map-page {
    --map-blue: #145bcc;
    --map-blue-dark: #1047a0;
    --map-ink: #19324f;
    --map-muted: #718096;
    --map-border: #e1e8f0;
    --map-soft: #f3f7fd;

    padding: 36px 0 64px;
    background: #f5f7fb;
    color: var(--map-ink);

    font-family:
        'Poppins',
        'Noto Sans Khmer',
        Arial,
        sans-serif;

    font-size: 14px;
    line-height: 1.6;
}

.map-page *,
.map-page *::before,
.map-page *::after {
    box-sizing: border-box;
}

.map-page button,
.map-page input,
.map-page select {
    font: inherit;
}

.map-page button {
    cursor: pointer;
}

.map-page a {
    text-decoration: none;
}

.map-page [hidden] {
    display: none !important;
}

.map-page :is(button, a, input, select):focus-visible {
    outline: 3px solid #83b4ff;
    outline-offset: 3px;
}

.map-container {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

/* ================= HEADER ================= */

.map-hero {
    padding: 26px;
    margin-bottom: 22px;

    background: #fff;
    border: 1px solid var(--map-border);
    border-radius: 18px;

    box-shadow: 0 4px 18px rgb(25 50 79 / 4%);
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.map-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.map-title-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;

    display: grid;
    place-items: center;

    color: var(--map-blue);
    background: #edf4ff;
    border: 1px solid #dbe8fc;
    border-radius: 15px;
}

.map-title-icon svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-heading-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.map-title-wrap h1 {
    margin: 0;
    color: var(--map-ink);
    font-size: clamp(20px, 2.2vw, 27px);
    font-weight: 700;
    line-height: 1.5;
}

.map-title-wrap p {
    margin: 5px 0 0;
    color: var(--map-muted);
    font-size: 13px;
}

/* ================= VIEW BUTTONS ================= */

.map-view-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 5px;

    background: var(--map-soft);
    border: 1px solid var(--map-border);
    border-radius: 12px;
}

.view-btn {
    min-height: 40px;
    padding: 0 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 8px;

    font-size: 12px;
    font-weight: 600;
    transition: background .2s, color .2s;
}

.view-btn:hover {
    color: var(--map-blue);
    background: #e5eefc;
}

.view-btn.active {
    color: #fff;
    background: var(--map-blue);
    box-shadow: 0 3px 8px rgb(20 91 204 / 18%);
}

/* ================= FLOORS + SEARCH ================= */

.floor-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--map-border);
}

.floor-tab {
    min-height: 44px;
    padding: 8px 13px;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #52657c;
    background: #fff;
    border: 1px solid var(--map-border);
    border-radius: 10px;

    font-size: 12px;
    transition: background .2s, border-color .2s;
}

.floor-tab strong {
    font-weight: 600;
}

.floor-tab > i {
    color: #8799b0;
}

.floor-tab span {
    padding: 2px 7px;
    color: #6c7d94;
    background: #f0f3f8;
    border-radius: 6px;
    font-size: 10px;
}

.floor-tab:hover {
    color: var(--map-blue);
    background: #f5f9ff;
    border-color: #aecaf3;
}

.floor-tab.active {
    color: var(--map-blue);
    background: #edf4ff;
    border-color: #a9c7f5;
}

.floor-tab.active > i {
    color: var(--map-blue);
}

.floor-tab.active span {
    color: var(--map-blue);
    background: #dceaff;
}

.room-search {
    display: flex;
    align-items: center;
    gap: 10px;

    flex: 1 1 260px;
    max-width: 340px;
    min-width: 0;
    min-height: 46px;
    margin-left: auto;
    padding: 0 13px;

    background: #f8fafc;
    border: 1px solid var(--map-border);
    border-radius: 10px;
}

.room-search:focus-within {
    background: #fff;
    border-color: #8cb5f0;
    box-shadow: 0 0 0 3px rgb(20 91 204 / 8%);
}

.room-search > i {
    color: #8a9bb1;
    flex-shrink: 0;
}

.room-search input {
    width: 100%;
    min-width: 0;
    padding: 11px 0;

    color: var(--map-ink);
    background: transparent;
    border: 0;

    font-size: 12px;
}

.room-search input:focus {
    outline: none;
}

.room-search input::placeholder {
    color: #8998aa;
}

.room-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.clear-search {
    display: none;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;

    color: #718096;
    background: transparent;
    border: 0;
    border-radius: 7px;
}

.clear-search.show {
    display: inline-flex;
}

.clear-search:hover {
    color: var(--map-blue);
    background: #e8f0fc;
}

/* ================= FILTER BAR ================= */

.floor-content {
    display: none;
}

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

.room-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;

    margin-bottom: 18px;
}

.filter-status,
.filter-type {
    display: flex;
    align-items: center;
    gap: 9px;
}

.filter-label,
.filter-type label {
    color: var(--map-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
}

.all-rooms-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 38px;
    padding: 0 12px;

    color: #345275;
    background: #eaf0f8;
    border-radius: 8px;

    font-size: 12px;
    font-weight: 500;
}

.all-rooms-badge strong {
    color: var(--map-blue);
}

.room-type-select {
    min-height: 40px;
    max-width: 100%;
    padding: 0 30px 0 12px;

    color: #425b78;
    background: #fff;
    border: 1px solid var(--map-border);
    border-radius: 8px;

    font-size: 12px;
    cursor: pointer;
}

/* ================= ROOM CARDS ================= */

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

.room-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    background: #fff;
    border: 1px solid var(--map-border);
    border-radius: 15px;

    box-shadow: 0 3px 12px rgb(25 50 79 / 3%);
    transition:
        transform .2s,
        box-shadow .2s,
        border-color .2s;
}

.room-card:hover {
    transform: translateY(-4px);
    border-color: #bad0ef;
    box-shadow: 0 10px 24px rgb(25 50 79 / 9%);
}

.room-card-image {
    position: relative;
    height: 185px;
    flex-shrink: 0;
    overflow: hidden;
    background: #edf3fa;
}

.room-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.room-card:hover .room-card-image img {
    transform: scale(1.06);
}

.room-card-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;

    color: #88a7ce;
    background: linear-gradient(135deg, #edf4ff, #e3edf8);
    font-size: 43px;
}

.room-photo-count {
    position: absolute;
    right: 12px;
    bottom: 12px;

    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;

    color: #fff;
    background: rgb(16 35 61 / 78%);
    border-radius: 7px;

    font-size: 10px;
    font-weight: 500;
}

.room-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 18px;
}

.room-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 28px;
}

.room-floor-name {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: #7c8ba0;
    font-size: 11px;
}

.room-type {
    padding: 3px 8px;
    color: #2b65b0;
    background: #edf4ff;
    border-radius: 6px;

    font-size: 10px;
    overflow-wrap: anywhere;
}

.room-card-body h3 {
    margin: 11px 0 3px;
    color: var(--map-ink);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.room-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;

    min-height: 44px;
    max-height: 44px;
    margin: 0 0 16px;
    overflow: hidden;

    color: #687b93;
    font-size: 13px;
    line-height: 22px;
    overflow-wrap: anywhere;
}

.equipment-block {
    margin-top: auto;
    padding-top: 13px;
    border-top: 1px solid #edf1f6;
}

.equipment-title {
    color: #8a98aa;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .8px;
}

.equipment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.equipment-chips span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;

    color: #61758e;
    background: #f5f7fb;
    border-radius: 6px;

    font-size: 10px;
}

.equipment-chips i {
    color: #7596bf;
}

.room-detail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    min-height: 42px;
    margin-top: 17px;
    padding: 9px 12px;

    color: var(--map-blue);
    background: #eef4ff;
    border: 1px solid #dce8fc;
    border-radius: 9px;

    font-size: 12px;
    font-weight: 600;
    transition: background .2s, color .2s;
}

.room-detail-btn:hover {
    color: #fff;
    background: var(--map-blue);
    border-color: var(--map-blue);
}

/* ================= LIST VIEW ================= */

.map-container.list-view .rooms-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.map-container.list-view .room-card {
    flex-direction: row;
}

.map-container.list-view .room-card-image {
    width: 240px;
    height: auto;
    min-height: 220px;
}

.map-container.list-view .room-name {
    min-height: 0;
}

.map-container.list-view .room-detail-btn {
    width: 180px;
    align-self: flex-end;
}

/* ================= BLUEPRINT ================= */

/* Layout appears only when Blueprint is selected. */
.floor-layout {
    display: none;
    padding: 23px;

    background: #fff;
    border: 1px solid var(--map-border);
    border-radius: 16px;
}

.map-container.blueprint-view .rooms-grid {
    display: none;
}

.map-container.blueprint-view .floor-layout {
    display: block;
}

.layout-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;

    margin-bottom: 19px;
}

.layout-heading h2 {
    margin: 0;
    color: var(--map-ink);
    font-size: 19px;
    font-weight: 600;
}

.layout-heading h2 i {
    margin-right: 6px;
    color: var(--map-blue);
}

.layout-heading p {
    margin: 5px 0 0;
    color: var(--map-muted);
    font-size: 12px;
}

/* Hide availability labels: the supplied rooms
   do not contain availability status data. */
.layout-legend {
    display: none;
}

.blueprint-stage {
    padding: 24px;
    overflow: hidden;

    background-color: #f5f9ff;
    background-image:
        linear-gradient(#dce7f5 1px, transparent 1px),
        linear-gradient(90deg, #dce7f5 1px, transparent 1px);
    background-size: 24px 24px;

    border: 1px solid #d9e5f5;
    border-radius: 12px;
}

.blueprint-rooms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.blueprint-room {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-height: 130px;
    padding: 17px;

    color: var(--map-ink);
    background: #fff;
    border: 2px solid #bed2ee;
    border-radius: 8px;

    transition: background .2s, border-color .2s;
}

.blueprint-room:hover {
    background: #edf4ff;
    border-color: var(--map-blue);
}

.blueprint-room small {
    color: var(--map-blue);
    font-size: 12px;
    font-weight: 700;
}

.blueprint-room strong {
    margin: 6px 0;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.blueprint-room span {
    color: var(--map-muted);
    font-size: 11px;
}

.blueprint-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #d9e5f5;

    color: #71839b;
    font-size: 11px;
}

/* ================= EMPTY STATE ================= */

.map-empty,
.floor-room-empty {
    padding: 48px 20px;
    text-align: center;
    background: #fff;
    border: 1px dashed #ccd8e8;
    border-radius: 15px;
}

.floor-room-empty {
    grid-column: 1 / -1;
}

.map-empty-icon,
.floor-room-empty > i {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;

    color: #7798c3;
    background: #edf4ff;
    border-radius: 16px;
    font-size: 25px;
}

.map-empty h2,
.floor-room-empty h3 {
    margin: 15px 0 6px;
    font-size: 19px;
}

.map-empty p,
.floor-room-empty p {
    margin: 0;
    color: var(--map-muted);
    font-size: 13px;
}

/* ================= TABLET ================= */

@media (max-width: 1000px) {
    .map-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .rooms-grid,
    .blueprint-rooms {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ================= MOBILE ================= */

@media (max-width: 600px) {
    .map-page {
        padding: 22px 0 40px;
    }

    .map-container {
        width: calc(100% - 28px);
    }

    .map-hero {
        padding: 18px;
        border-radius: 14px;
    }

    .map-title-wrap {
        align-items: flex-start;
        gap: 11px;
    }

    .map-title-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 12px;
    }

    .map-title-icon svg {
        width: 25px;
        height: 25px;
    }

    .map-title-wrap h1 {
        font-size: 19px;
    }

    .map-title-wrap p {
        font-size: 11px;
    }

    .map-view-buttons {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        padding-inline: 7px;
        font-size: 11px;
    }

    .floor-tabs {
        gap: 8px;
        margin-top: 19px;
        padding-top: 17px;
    }

    .floor-tab {
        padding-inline: 10px;
        font-size: 11px;
    }

    .room-search {
        flex-basis: 100%;
        width: 100%;
        max-width: none;
        margin: 5px 0 0;
    }

    .room-filter-bar {
        gap: 10px;
    }

    .filter-status,
    .filter-type {
        gap: 6px;
    }

    .filter-label,
    .filter-type label {
        font-size: 10px;
    }

    .all-rooms-badge {
        padding-inline: 9px;
        font-size: 11px;
    }

    .room-type-select {
        width: 145px;
        font-size: 11px;
    }

    .rooms-grid,
    .blueprint-rooms {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .room-card-image {
        height: 200px;
    }

    .map-container.list-view .room-card {
        flex-direction: column;
    }

    .map-container.list-view .room-card-image {
        width: 100%;
        height: 180px;
        min-height: 0;
    }

    .map-container.list-view .room-detail-btn {
        width: 100%;
    }

    .floor-layout {
        padding: 16px;
    }

    .layout-heading h2 {
        font-size: 17px;
    }

    .blueprint-stage {
        padding: 16px;
    }
}

/* ================= REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {
    .map-page *,
    .map-page *::before,
    .map-page *::after {
        transition: none !important;
        animation: none !important;
    }

    .room-card:hover,
    .room-card:hover .room-card-image img {
        transform: none;
    }
}
/* Header ស្អាត និងសាមញ្ញ */
.map-page {
    --map-blue: #006b96;
    --map-blue-dark: #005475;
    background: #f5f7fa;
}

.map-hero {
    padding: 26px;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
}

.map-title-icon {
    color: #fff;
    background: var(--map-blue);
    border: 0;
    border-radius: 10px;
}

.map-title-wrap h1 {
    font-size: clamp(19px, 2vw, 25px);
}

.map-title-wrap p {
    max-width: 650px;
    line-height: 1.8;
}

/* Grid / List / Blueprint បែបមូល */
.map-view-buttons {
    padding: 4px;
    border: 0;
    border-radius: 30px;
    background: #f0f2f5;
}

.view-btn {
    min-height: 34px;
    padding-inline: 12px;
    border-radius: 24px;
    font-size: 11px;
}

.view-btn.active {
    background: var(--map-blue);
    box-shadow: none;
}

/* Floor tabs បែប pill */
.floor-tabs {
    margin-top: 24px;
    padding-top: 0;
    border-top: 0;
}

.floor-tab {
    min-height: 36px;
    padding: 6px 12px;
    border: 0;
    border-radius: 24px;
    background: #edf0f4;
}

.floor-tab span {
    background: #dde3eb;
    border-radius: 20px;
}

.floor-tab.active {
    color: #fff;
    background: #172238;
}

.floor-tab.active > i {
    color: #fff;
}

.floor-tab.active span {
    color: #fff;
    background: #384459;
}

/* Search */
.room-search {
    min-height: 40px;
    background: #f0f2f5;
    border-color: transparent;
    border-radius: 25px;
}

.room-search input {
    padding-block: 9px;
}

/* Filter bar */
.room-filter-bar {
    margin-bottom: 16px;
}

.all-rooms-badge {
    min-height: 32px;
    color: #fff;
    background: #172238;
    border-radius: 20px;
}

.all-rooms-badge strong {
    color: #fff;
}

.room-type-select {
    min-height: 36px;
    border-radius: 20px;
}

/* Room cards */
.rooms-grid {
    gap: 18px;
}

.room-card {
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    box-shadow: none;
}

.room-card:hover {
    border-color: #bdd6e2;
    box-shadow: 0 8px 22px rgb(25 50 79 / 8%);
}

.room-card-image {
    height: 190px;
}

.room-card-body {
    padding: 17px;
}

.room-floor-name {
    color: var(--map-blue);
    font-size: 10px;
    font-weight: 600;
}

.room-type {
    color: #35628b;
    background: #edf3fa;
    border-radius: 20px;
}

.room-card-body h3 {
    margin-top: 9px;
    font-size: 22px;
}

.room-name {
    font-size: 12px;
}

.equipment-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.equipment-chips span {
    min-width: 0;
    padding: 6px 8px;
    background: #f1f4f8;
    overflow-wrap: anywhere;
}

.equipment-chips i {
    color: var(--map-blue);
}

.room-detail-btn {
    min-height: 39px;
    color: #fff;
    background: var(--map-blue);
    border-color: var(--map-blue);
    border-radius: 8px;
}

.room-detail-btn:hover {
    background: var(--map-blue-dark);
    border-color: var(--map-blue-dark);
}

@media (max-width: 600px) {
    .map-hero {
        padding: 18px;
    }

    .map-view-buttons {
        width: 100%;
    }

    .room-search {
        margin-top: 7px;
    }

    .room-card-image {
        height: 200px;
    }
}

/* ===== Map style តាមរូបគំរូ ===== */

.map-page {
    --map-blue: #008ac3;
    --map-ink: #14283f;
    --map-muted: #8292aa;
    --map-border: #e2e9f2;

    padding: 30px 0 55px;
    background: #f3f6fb;
}

.map-container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

/* Header */
.map-page .map-hero {
    padding: 22px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e0e8f2;
    border-radius: 14px;
    box-shadow: 0 3px 8px rgb(22 46 78 / 5%);
}

.map-header {
    gap: 20px;
}

.map-title-wrap {
    align-items: center;
    gap: 12px;
}

.map-title-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    color: #fff;
    background: #0079a8;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgb(0 80 130 / 15%);
}

.map-title-icon svg {
    width: 25px;
    height: 25px;
}

.map-title-wrap h1 {
    margin: 0;
    color: #102239;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.5px;
}

.map-title-wrap p {
    margin: 3px 0 0;
    color: #8292aa;
    font-size: 12px;
    line-height: 1.6;
}

/* View selector */
.map-view-buttons {
    width: auto;
    padding: 3px;
    gap: 3px;
    background: #f3f6fa;
    border: 1px solid #e1e9f3;
    border-radius: 10px;
}

.view-btn {
    min-height: 30px;
    padding: 0 11px;
    gap: 5px;
    color: #40536f;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 500;
}

.view-btn.active {
    color: #fff;
    background: #008ac3;
    box-shadow: none;
}

/* Floors and search */
.floor-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;

    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #edf1f6;
}

.floor-tab {
    min-height: 35px;
    padding: 6px 12px;
    gap: 7px;

    color: #213b5c;
    background: #fff;
    border: 1px solid #e1e9f4;
    border-radius: 9px;
    font-size: 11px;
}

.floor-tab span {
    padding: 1px 6px;
    color: #7e92ae;
    background: #f0f4f9;
    border-radius: 7px;
    font-size: 9px;
}

.floor-tab.active {
    color: #fff;
    background: #102139;
    border-color: #102139;
    box-shadow: none;
}

.floor-tab.active > i {
    color: #27b9f2;
}

.floor-tab.active span {
    color: #d3efff;
    background: #204569;
}

.room-search {
    flex: 1 1 240px;
    max-width: 290px;
    min-height: 35px;

    margin-left: auto;
    padding: 0 11px;

    background: #fff;
    border: 1px solid #e1e9f4;
    border-radius: 10px;
}

.room-search input {
    padding: 8px 0;
    font-size: 10px;
}

.room-search > i {
    font-size: 11px;
}

.clear-search {
    width: 24px;
    height: 24px;
}

/* Filter row */
.map-page .room-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    width: 100%;
    margin: 0 0 18px;
    padding: 0 4px;
}

.filter-status,
.filter-type {
    gap: 8px;
}

.map-page .filter-label,
.map-page .filter-type label {
    color: #94a2b8;
    font-size: 10px;
    font-weight: 600;
}

.all-rooms-badge {
    min-height: 25px;
    padding: 3px 11px;
    gap: 4px;

    color: #fff;
    background: #102139;
    border-radius: 7px;
    font-size: 10px;
}

.all-rooms-badge strong {
    color: #fff;
    font-size: inherit;
}

.room-type-select {
    min-height: 30px;
    padding: 0 27px 0 11px;
    color: #3e5878;
    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 8px;
    font-size: 10px;
}

/* Cards */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.room-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    background: #fff;
    border: 1px solid #e2e9f2;
    border-radius: 14px;
    box-shadow: 0 3px 7px rgb(28 51 81 / 5%);
}

.room-card:hover {
    transform: translateY(-3px);
    border-color: #bed9eb;
    box-shadow: 0 8px 20px rgb(28 51 81 / 9%);
}

.room-card-image {
    position: relative;
    height: 200px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f4f9;
}

.room-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.room-photo-count {
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;

    color: #fff;
    background: rgb(25 28 32 / 75%);
    border-radius: 5px;
    font-size: 10px;
}

.room-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 17px;
}

.room-meta-row {
    min-height: 24px;
    gap: 7px;
}

.room-floor-name {
    color: #008ac3;
    font-size: 10px;
    font-weight: 600;
}

.room-type {
    padding: 3px 9px;
    color: #007fae;
    background: #eff9ff;
    border: 1px solid #e0f0fb;
    border-radius: 20px;
    font-size: 9px;
}

.room-card-body h3 {
    margin: 10px 0 1px;
    color: #233854;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.4;
}

.room-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;

    min-height: 40px;
    max-height: 40px;
    margin: 0 0 12px;
    overflow: hidden;

    color: #788ba6;
    font-size: 12px;
    line-height: 20px;
}

.equipment-block {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #edf1f6;
}

.equipment-title {
    color: #95a4bb;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .2px;
}

.equipment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.equipment-chips span {
    padding: 4px 7px;
    color: #5e738e;
    background: #f1f4f9;
    border-radius: 5px;
    font-size: 9px;
}

.equipment-chips i {
    color: #8195af;
}

/* Full-width button */
.map-page .room-detail-btn {
    width: 100%;
    min-height: 35px;
    margin: 18px 0 0;
    padding: 7px 12px;

    color: #fff;
    background: #283d5a;
    border: 0;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
}

.room-card:first-child .room-detail-btn {
    background: #008ac3;
}

.map-page .room-detail-btn:hover {
    color: #fff;
    background: #0076a8;
}

/* Tablet */
@media (max-width: 1000px) {
    .map-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .rooms-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 600px) {
    .map-page {
        padding: 20px 0 40px;
    }

    .map-container {
        width: calc(100% - 28px);
    }

    .map-page .map-hero {
        padding: 17px;
    }

    .map-title-wrap h1 {
        font-size: 18px;
        letter-spacing: -.3px;
    }

    .map-title-wrap p {
        font-size: 11px;
    }

    .map-view-buttons {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        min-height: 34px;
    }

    .room-search {
        flex-basis: 100%;
        max-width: none;
        margin: 5px 0 0;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .room-card-image {
        height: 210px;
    }

    .map-container.list-view .room-card-image {
        height: 180px;
    }

    .map-container.list-view .room-detail-btn {
        width: 100%;
    }
}

.map-page .map-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 0;

    color: #fff;
    background: #087fae;
    border: 1px solid #087fae;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgb(8 127 174 / 15%);
}

.map-page .map-title-icon svg {
    display: block;
    width: 26px;
    height: 26px;
    margin: 0;
    color: inherit;
}

/* សម្រាប់ SVG ដែលគូរដោយបន្ទាត់ */
.map-page .map-title-icon svg[fill="none"],
.map-page .map-title-icon svg [stroke] {
    stroke: currentColor;
}

.map-page .map-title-icon > i {
    color: inherit;
    font-size: 24px;
    line-height: 1;
}
/* ជាន់ និងប្រភេទបន្ទប់ */
.map-page .room-floor-name {
    font-size: 13px;
}

.map-page .room-type {
    font-size: 12px;
    padding: 4px 10px;
}

/* លេខបន្ទប់ */
.map-page .room-card-body h3 {
    font-size: 28px;
}

/* ឈ្មោះបន្ទប់ */
.map-page .room-name {
    font-size: 15px;
    line-height: 24px;
    min-height: 48px;
    max-height: 48px;
}

/* ព័ត៌មានឧបករណ៍ */
.map-page .equipment-title {
    font-size: 11px;
}

.map-page .equipment-chips span {
    font-size: 12px;
    padding: 6px 9px;
}

.map-page .equipment-chips i {
    font-size: 12px;
}

/* ប៊ូតុង View Room */
.map-page .room-detail-btn {
    font-size: 14px;
    min-height: 42px;
}
.map-page .room-search {
    min-height: 44px;
    padding-inline: 14px;
}

.map-page .room-search input {
    font-size: 14px;
    line-height: 1.5;
    padding-block: 11px;
}

.map-page .room-search > i {
    font-size: 16px;
}

.map-page [hidden] {
    display: none !important;
}

.room-no-results {
    padding: 28px 18px;
    margin: 16px 0;
    text-align: center;
    color: #718096;
    background: #fff;
    border: 1px dashed #d5dfec;
    border-radius: 12px;
    font-size: 13px;
}

.map-page .filter-label,
.map-page .filter-type label {
    font-size: 13px;
    font-weight: 600;
    color: #71839c;
    letter-spacing: 0.4px;
} 
.map-heading-line h1.map-directory-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;

    color: #14283f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.7;
    letter-spacing: normal;
}

.map-heading-line .map-directory-title .title-divider {
    color: #14283f;
    font-weight: 400;
}

.map-heading-line .map-directory-title [lang="km"] {
    color: #007fae;
    font-family: "Khmer OS Muol Light", "Noto Serif Khmer", serif;
    font-size: 19px;
    font-weight: 400;
}
.map-heading-line h1.map-directory-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0;

    font-size: 20px;
    line-height: 1.6;
}

.map-heading-line h1.map-directory-title > span:first-child {
    color: #14283f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

.map-heading-line h1.map-directory-title > .title-divider {
    color: #bcc7d3;
    font-size: 19px;
    font-weight: 400;
}

.map-heading-line h1.map-directory-title > [lang="km"] {
    color: #007fae;
    font-family: "Khmer OS Muol Light", "Noto Serif Khmer", serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: normal;
}

.map-heading-line + p {
    margin: 6px 0 0;
    color: #7b8ca3;
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 600px) {
    .map-heading-line h1.map-directory-title > span:first-child {
        font-size: 17px;
    }

    .map-heading-line h1.map-directory-title > [lang="km"] {
        font-size: 16px;
    }
}   
.map-heading-line {
    margin: 0;
    padding: 0;
}

.map-heading-line h1.map-directory-title {
    margin: 0;
    padding: 0;
    line-height: 1.3;
    row-gap: 0;
}

.map-heading-line h1.map-directory-title > [lang="km"] {
    line-height: 1.4;
}

.map-heading-line + p {
    margin: 4px 0 0;
    padding: 0;
    line-height: 1.4;
}
.map-heading-line h1.map-directory-title > span:first-child {
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: normal;
}
.map-heading-line {
    padding-top: 8px;
}

.map-heading-line + p {
    margin-top: 0;
    transform: translateY(-8px);
}
.map-page .floor-tabs {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px;
    min-width: 0;
}

.map-page .floor-tabs-scroll {
    display: flex;
    align-items: center;
    gap: 10px;

    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    padding: 4px 0 8px;

    scrollbar-width: thin;
    scrollbar-color: #b8cce2 transparent;
    -webkit-overflow-scrolling: touch;
}

.map-page .floor-tabs-scroll .floor-tab {
    flex: 0 0 auto;
    white-space: nowrap;
}

.map-page .floor-tabs > .room-search {
    flex: 0 1 340px;
    min-width: 220px;
    max-width: 340px;
    margin: 0;
}

.map-page .floor-tabs-scroll::-webkit-scrollbar {
    height: 5px;
}

.map-page .floor-tabs-scroll::-webkit-scrollbar-thumb {
    background: #b8cce2;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .map-page .floor-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .map-page .floor-tabs-scroll {
        flex: none;
        width: 100%;
    }

    .map-page .floor-tabs > .room-search {
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
    }
}
.map-page .floor-tabs-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0;
}

.map-page .floor-tabs-scroll::-webkit-scrollbar {
    display: none;
}
.map-page .floor-tabs {
    align-items: center;
}

.map-page .floor-tabs-scroll {
    align-items: center;
    padding-block: 0;
}

.map-page .floor-tabs-scroll .floor-tab {
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
}

.map-page .floor-tabs > .room-search {
    box-sizing: border-box;
    height: 44px;
    min-height: 44px;
}

.map-page .room-search input {
    padding-block: 0;
}
/* Font អង់គ្លេស និងខ្មែរ */
.map-page {
    font-family: Arial, "Noto Sans Khmer", sans-serif;
}

/* ចំណងជើងអង់គ្លេស */
.map-heading-line h1.map-directory-title > span:first-child {
    font-family: Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: normal;
}

/* លេខបន្ទប់ */
.map-page .room-card-body h3 {
    font-family: Arial, "Noto Sans Khmer", sans-serif;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: normal;
}

/* ឈ្មោះបន្ទប់ */
.map-page .room-name {
    font-size: 15px;
    font-weight: 400;
}

/* ជាន់ និងប៊ូតុង */
.map-page .room-floor-name,
.map-page .floor-tab strong,
.map-page .room-detail-btn {
    font-weight: 600;
}

/* ព័ត៌មានឧបករណ៍ */
.map-page .equipment-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.map-page .equipment-chips span {
    font-size: 12px;
    font-weight: 400;
}
body .map-page,
body .map-page *:not(i):not(svg):not(svg *):not(
    .fa, .fas, .far, .fab,
    .fa-solid, .fa-regular, .fa-brands
) {
    font-family:
        Georgia,
        "Times New Roman",
        "Battambang",
        "Khmer OS Battambang",
        serif !important;

    font-weight: 400 !important;
    font-style: normal !important;
    letter-spacing: normal !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
    font-variant-numeric: lining-nums;
}
.map-page .room-filter-bar {
    margin-top: 12px !important;
}

.map-page .filter-status,
.map-page .filter-type {
    display: flex;
    align-items: center;
    gap: 10px;
}
.map-page .floor-tabs {
    min-width: 0;
}

.map-page .floor-tabs-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto !important;
    scrollbar-width: thin;
}

.map-page .floor-tabs-scroll .floor-tab {
    flex: 0 0 auto !important;
}

.map-page .floor-tabs-scroll::-webkit-scrollbar {
    display: block !important;
    height: 5px;
}

.map-page [hidden] {
    display: none !important;
}

@media (min-width: 992px) {
    .map-page {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    .map-page .map-container {
        width: 100% !important;
        max-width: 1420px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box;
    }
}

@media (min-width: 1200px) {
    .map-page .rooms-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 20px !important;
    }

    .map-page .rooms-grid > .room-card {
        min-width: 0;
    }
}
@media (min-width: 1200px) {
    .map-page .rooms-grid .room-card {
        min-height: 0 !important;
    }

    .map-page .rooms-grid .room-card-image {
        height: 180px !important;
        min-height: 0 !important;
    }

    .map-page .rooms-grid .room-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .map-page .rooms-grid .room-card-body {
        padding: 16px !important;
        gap: 0 !important;
        min-height: 0 !important;
    }

    .map-page .rooms-grid .room-meta-row {
        margin-bottom: 10px !important;
    }

    .map-page .rooms-grid .room-card-body h3 {
        margin: 0 0 6px !important;
    }

    .map-page .rooms-grid .room-name {
        min-height: 0 !important;
        margin: 0 0 14px !important;
    }

    .map-page .rooms-grid .equipment-block {
        margin-top: 0 !important;
        padding-top: 12px !important;
    }

    .map-page .rooms-grid .room-detail-btn {
        margin-top: 14px !important;
        padding: 10px 14px !important;
        min-height: 0 !important;
    }
}

/* =========================================================
   FINAL MOBILE PHONE LAYOUT
   Safe overrides only: desktop layout and page behavior remain unchanged.
========================================================= */
@media (max-width: 767px) {
    .map-page {
        padding: 16px 0 34px !important;
        font-size: 13px !important;
        overflow-x: clip;
    }

    .map-page .map-container {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        margin-inline: auto !important;
    }

    /* Header */
    .map-page .map-hero {
        padding: 14px !important;
        margin-bottom: 14px !important;
        border-radius: 13px !important;
    }

    .map-page .map-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 13px !important;
    }

    .map-page .map-title-wrap {
        align-items: flex-start !important;
        gap: 10px !important;
        min-width: 0 !important;
    }

    .map-page .map-title-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        flex: 0 0 38px !important;
        margin-top: 2px !important;
        border-radius: 10px !important;
    }

    .map-page .map-title-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .map-page .map-title-wrap > div,
    .map-page .map-heading-line {
        min-width: 0 !important;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }

    .map-page .map-heading-line h1.map-directory-title {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 16px !important;
        line-height: 1.4 !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-heading-line h1.map-directory-title > span:first-child {
        font-size: 16px !important;
        line-height: 1.35 !important;
        font-weight: 700 !important;
    }

    .map-page .map-heading-line h1.map-directory-title > .title-divider {
        display: none !important;
    }

    .map-page .map-heading-line h1.map-directory-title > [lang="km"] {
        margin-top: 2px !important;
        font-size: 15px !important;
        line-height: 1.55 !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-title-wrap p,
    .map-page .map-heading-line + p {
        margin: 5px 0 0 !important;
        padding: 0 !important;
        transform: none !important;
        font-size: 11px !important;
        line-height: 1.6 !important;
        overflow-wrap: anywhere;
    }

    /* Grid / List / Blueprint controls */
    .map-page .map-view-buttons {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 4px !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 4px !important;
        margin: 0 !important;
        border-radius: 10px !important;
    }

    .map-page .view-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        min-width: 0 !important;
        min-height: 37px !important;
        padding: 5px 3px !important;
        border-radius: 7px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        white-space: nowrap;
    }

    .map-page .view-btn i {
        font-size: 10px !important;
        flex: 0 0 auto;
    }

    /* Horizontal floor tabs with touch-friendly buttons */
    .map-page .floor-tabs {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        min-width: 0 !important;
        margin-top: 14px !important;
        padding-top: 13px !important;
    }

    .map-page .floor-tabs-scroll {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        gap: 7px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 2px 1px 5px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
    }

    .map-page .floor-tabs-scroll::-webkit-scrollbar {
        display: none !important;
    }

    .map-page .floor-tabs-scroll .floor-tab {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        height: auto !important;
        padding: 7px 10px !important;
        gap: 6px !important;
        border-radius: 9px !important;
        scroll-snap-align: start;
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    .map-page .floor-tabs-scroll .floor-tab strong {
        font-size: 11px !important;
    }

    .map-page .floor-tabs-scroll .floor-tab span {
        padding: 2px 6px !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    .map-page .floor-tabs > .room-search {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 0 11px !important;
        gap: 8px !important;
        border-radius: 10px !important;
    }

    .map-page .room-search > i {
        font-size: 13px !important;
    }

    .map-page .room-search input {
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    /* Room count and type selector */
    .map-page .room-filter-bar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 9px !important;
        margin: 10px 0 13px !important;
        padding: 0 !important;
    }

    .map-page .filter-status,
    .map-page .filter-type {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 0 !important;
    }

    .map-page .filter-label,
    .map-page .filter-type label {
        flex: 0 0 auto;
        font-size: 9px !important;
        line-height: 1.2 !important;
        letter-spacing: 0 !important;
    }

    .map-page .all-rooms-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        min-width: 0 !important;
        min-height: 31px !important;
        padding: 4px 8px !important;
        border-radius: 8px !important;
        font-size: 10px !important;
        line-height: 1.25 !important;
        white-space: nowrap;
    }

    .map-page .filter-type {
        justify-content: flex-end !important;
    }

    .map-page .room-type-select {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 150px !important;
        min-height: 34px !important;
        padding: 0 24px 0 8px !important;
        border-radius: 8px !important;
        font-size: 10px !important;
    }

    /* Room cards */
    .map-page .rooms-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .map-page .room-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        border-radius: 12px !important;
        transform: none !important;
        box-shadow: 0 3px 12px rgb(25 50 79 / 5%) !important;
    }

    .map-page .room-card-image,
    .map-page .map-container.list-view .room-card-image {
        width: 100% !important;
        height: clamp(145px, 46vw, 185px) !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
    }

    .map-page .room-card-image img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .map-page .room-photo-count {
        right: 9px !important;
        bottom: 9px !important;
        gap: 5px !important;
        padding: 4px 7px !important;
        border-radius: 6px !important;
        font-size: 9px !important;
    }

    .map-page .room-card-body {
        display: flex !important;
        flex-direction: column !important;
        min-width: 0 !important;
        padding: 12px !important;
        gap: 0 !important;
    }

    .map-page .room-meta-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        min-height: 0 !important;
        margin-bottom: 7px !important;
    }

    .map-page .room-floor-name {
        gap: 5px !important;
        font-size: 10px !important;
        line-height: 1.4 !important;
    }

    .map-page .room-type {
        max-width: 100% !important;
        padding: 3px 7px !important;
        border-radius: 20px !important;
        font-size: 9px !important;
        line-height: 1.3 !important;
        overflow-wrap: anywhere;
    }

    .map-page .room-card-body h3 {
        margin: 0 0 3px !important;
        font-size: 23px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        overflow-wrap: anywhere;
    }

    .map-page .room-name {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 0 12px !important;
        overflow: hidden !important;
        font-size: 12px !important;
        line-height: 1.65 !important;
        overflow-wrap: anywhere;
    }

    .map-page .equipment-block {
        margin-top: 0 !important;
        padding-top: 10px !important;
        border-top: 1px solid #edf1f6;
    }

    .map-page .equipment-title {
        font-size: 9px !important;
        line-height: 1.4 !important;
        letter-spacing: 0.3px !important;
    }

    .map-page .equipment-chips {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-top: 7px !important;
    }

    .map-page .equipment-chips span {
        display: flex !important;
        align-items: flex-start !important;
        min-width: 0 !important;
        gap: 5px !important;
        padding: 6px 7px !important;
        border-radius: 6px !important;
        font-size: 9px !important;
        line-height: 1.45 !important;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .map-page .equipment-chips i {
        flex: 0 0 auto;
        margin-top: 2px;
        font-size: 10px !important;
    }

    .map-page .room-detail-btn,
    .map-page .map-container.list-view .room-detail-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-height: 39px !important;
        margin: 12px 0 0 !important;
        padding: 9px 12px !important;
        border-radius: 8px !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    /* List mode should also remain usable on narrow screens */
    .map-page .map-container.list-view .room-card {
        flex-direction: column !important;
    }

    /* Blueprint view */
    .map-page .floor-layout {
        margin-top: 14px !important;
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .map-page .layout-heading {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 7px !important;
        margin-bottom: 12px !important;
    }

    .map-page .layout-heading h2 {
        font-size: 16px !important;
        line-height: 1.45 !important;
        overflow-wrap: anywhere;
    }

    .map-page .layout-heading p {
        margin: 4px 0 0 !important;
        font-size: 11px !important;
        line-height: 1.55 !important;
    }

    .map-page .blueprint-stage {
        padding: 10px !important;
        border-radius: 9px !important;
        background-size: 18px 18px !important;
    }

    .map-page .blueprint-rooms {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }

    .map-page .blueprint-room {
        min-width: 0 !important;
        min-height: 90px !important;
        padding: 11px !important;
        border-width: 1px !important;
        border-radius: 8px !important;
    }

    .map-page .blueprint-room small {
        font-size: 10px !important;
        line-height: 1.4 !important;
    }

    .map-page .blueprint-room strong {
        margin: 4px 0 !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        overflow-wrap: anywhere;
    }

    .map-page .blueprint-room span {
        font-size: 10px !important;
        line-height: 1.45 !important;
    }

    .map-page .blueprint-footer {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        margin-top: 12px !important;
        padding-top: 10px !important;
        font-size: 10px !important;
        line-height: 1.5 !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-empty,
    .map-page .floor-room-empty {
        padding: 28px 14px !important;
        border-radius: 12px !important;
    }

    .map-page .map-empty h2,
    .map-page .floor-room-empty h3 {
        margin: 12px 0 6px !important;
        font-size: 17px !important;
        line-height: 1.4 !important;
    }

    .map-page .map-empty p,
    .map-page .floor-room-empty p {
        font-size: 12px !important;
        line-height: 1.65 !important;
    }

    /* Disable hover-lift on touch screens */
    .map-page .room-card:hover,
    .map-page .room-card:hover .room-card-image img {
        transform: none !important;
    }
}

@media (max-width: 380px) {
    .map-page .map-container {
        width: calc(100% - 18px) !important;
    }

    .map-page .map-hero {
        padding: 11px !important;
    }

    .map-page .map-heading-line h1.map-directory-title > span:first-child {
        font-size: 15px !important;
    }

    .map-page .map-heading-line h1.map-directory-title > [lang="km"] {
        font-size: 14px !important;
    }

    .map-page .map-view-buttons {
        gap: 3px !important;
        padding: 3px !important;
    }

    .map-page .view-btn {
        gap: 4px !important;
        font-size: 9px !important;
    }

    .map-page .room-card-image,
    .map-page .map-container.list-view .room-card-image {
        height: 145px !important;
    }

    .map-page .room-card-body {
        padding: 10px !important;
    }

    .map-page .equipment-chips {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .map-page .room-filter-bar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 6px !important;
    }

    .map-page .filter-label,
    .map-page .filter-type label {
        font-size: 8px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-page .room-card,
    .map-page .room-card-image img,
    .map-page .view-btn,
    .map-page .floor-tab {
        transition: none !important;
    }
}

/* Compact floor tab pill on mobile */
@media (max-width: 767px) {
    .map-page .floor-tabs-scroll .floor-tab {
        width: max-content !important;
        max-width: max-content !important;
        min-width: 0 !important;
        min-height: 31px !important;
        height: 31px !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        gap: 5px !important;
        padding: 4px 9px !important;
        border-radius: 8px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    .map-page .floor-tabs-scroll .floor-tab > i {
        font-size: 10px !important;
    }

    .map-page .floor-tabs-scroll .floor-tab strong {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    .map-page .floor-tabs-scroll .floor-tab span {
        padding: 1px 5px !important;
        font-size: 8px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
    }
}

/* FINAL FIX: List view must override desktop 4-column Grid rule */
@media (min-width: 768px) {
    /* The desktop Grid rule uses !important, so List needs a stronger override. */
    .map-page .map-container.list-view .rooms-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    .map-page .map-container.list-view .room-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .map-page .map-container.list-view .room-card-image {
        flex: 0 0 260px !important;
        width: 260px !important;
        height: 220px !important;
        min-height: 220px !important;
        align-self: stretch !important;
    }

    .map-page .map-container.list-view .room-card-image img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .map-page .map-container.list-view .room-card-body {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 16px 18px !important;
    }

    .map-page .map-container.list-view .room-name {
        min-height: 0 !important;
        max-height: none !important;
        margin-bottom: 12px !important;
    }

    .map-page .map-container.list-view .equipment-chips {
        display: flex !important;
        flex-wrap: wrap !important;
        grid-template-columns: none !important;
    }

    .map-page .map-container.list-view .room-detail-btn {
        width: 180px !important;
        max-width: 100% !important;
        align-self: flex-end !important;
    }
}

/* Keep List cards readable on phones; stack image above the details. */
@media (max-width: 767px) {
    .map-page .map-container.list-view .rooms-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .map-page .map-container.list-view .room-card {
        flex-direction: column !important;
    }

    .map-page .map-container.list-view .room-card-image {
        flex: 0 0 auto !important;
        width: 100% !important;
        height: clamp(145px, 46vw, 185px) !important;
        min-height: 0 !important;
    }

    .map-page .map-container.list-view .room-card-body {
        width: 100% !important;
        min-width: 0 !important;
    }

    .map-page .map-container.list-view .room-detail-btn {
        width: 100% !important;
        align-self: stretch !important;
    }
}

/* =========================================================
   FINAL MOBILE VIEW SWITCH FIX
   Ensure List and Blueprint override earlier !important rules.
========================================================= */
@media (max-width: 767px) {
    /* LIST: make it visually different from Grid on phones. */
    .map-page .map-container.list-view .rooms-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .map-page .map-container.list-view .room-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }

    .map-page .map-container.list-view .room-card-image {
        flex: 0 0 112px !important;
        width: 112px !important;
        height: auto !important;
        min-height: 112px !important;
        align-self: stretch !important;
    }

    .map-page .map-container.list-view .room-card-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .map-page .map-container.list-view .room-card-body {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 10px !important;
        gap: 0 !important;
    }

    .map-page .map-container.list-view .room-meta-row {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        min-height: 0 !important;
        margin-bottom: 6px !important;
    }

    .map-page .map-container.list-view .room-floor-name {
        font-size: 9px !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-container.list-view .room-type {
        max-width: 100% !important;
        font-size: 9px !important;
        padding: 2px 6px !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-container.list-view .room-card-body h3 {
        margin: 0 0 3px !important;
        font-size: 19px !important;
        line-height: 1.3 !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-container.list-view .room-name {
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 0 7px !important;
        font-size: 11px !important;
        line-height: 1.45 !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-container.list-view .equipment-block {
        margin-top: 4px !important;
        padding-top: 7px !important;
    }

    .map-page .map-container.list-view .equipment-title {
        font-size: 8px !important;
    }

    .map-page .map-container.list-view .equipment-chips {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        margin-top: 5px !important;
    }

    .map-page .map-container.list-view .equipment-chips span {
        min-width: 0 !important;
        padding: 4px 5px !important;
        font-size: 8px !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-container.list-view .room-detail-btn {
        width: 100% !important;
        min-height: 30px !important;
        margin-top: 8px !important;
        padding: 6px !important;
        font-size: 10px !important;
        align-self: stretch !important;
    }

    /* BLUEPRINT: !important needed because an earlier mobile rule
       forces every .rooms-grid to display:grid !important. */
    .map-page .map-container.blueprint-view .rooms-grid {
        display: none !important;
    }

    .map-page .map-container.blueprint-view .floor-layout {
        display: block !important;
        width: 100% !important;
        padding: 12px !important;
    }

    .map-page .map-container.blueprint-view .blueprint-stage {
        padding: 10px !important;
    }

    .map-page .map-container.blueprint-view .blueprint-rooms {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }

    .map-page .map-container.blueprint-view .blueprint-room {
        min-width: 0 !important;
        min-height: 82px !important;
        padding: 12px !important;
        overflow-wrap: anywhere;
    }

    .map-page .map-container.blueprint-view .layout-heading {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .map-page .map-container.blueprint-view .layout-heading h2 {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }

    .map-page .map-container.blueprint-view .layout-heading p,
    .map-page .map-container.blueprint-view .blueprint-footer {
        font-size: 10px !important;
        line-height: 1.5 !important;
    }
}

/* Remove blue background from Building Classrooms Directory header */
.map-page .map-hero .map-header {
    background: #ffffff !important;
    background-image: none !important;
}
