:root {
    --public-mobile-gutter: 16px;
}

html,
body {
    max-width: 100%;
}

body {
    overflow-x: clip;
}

main,
section,
header,
footer,
nav,
.shell,
.v2-shell {
    min-width: 0;
    max-width: 100%;
}

img,
video,
iframe {
    max-width: 100%;
}

button,
input,
select,
textarea {
    min-width: 0;
    max-width: 100%;
}

@supports not (overflow: clip) {
    body {
        overflow-x: hidden;
    }
}

.v2-mobile-map-toggle {
    display: none;
}

@media (max-width: 720px) {
    .shell,
    .v2-shell {
        width: calc(100% - (var(--public-mobile-gutter) * 2));
        max-width: none;
    }

    /* 공개 메인 */
    .site-header__inner,
    .v2-site-header__inner {
        gap: 12px;
    }

    .brand,
    .brand__text,
    .v2-brand,
    .v2-brand > span:last-child,
    .site-header__actions,
    .v2-header-nav {
        min-width: 0;
    }

    .brand__text strong,
    .v2-brand > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-menu {
        max-height: calc(100dvh - var(--header-height));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-inline: var(--public-mobile-gutter);
    }

    .hero {
        min-height: auto;
        overflow: hidden;
        padding-top: calc(var(--header-height) + 50px);
        padding-bottom: 38px;
    }

    .hero__inner {
        gap: 0;
    }

    .hero__copy,
    .hero__lead {
        max-width: none;
    }

    .hero h1 {
        max-width: 100%;
        font-size: clamp(34px, 10.8vw, 48px);
        line-height: 1.1;
        letter-spacing: -.045em;
    }

    .hero__actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero__actions .button {
        width: 100%;
    }

    .hero__metrics {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
    }

    .hero__metrics div {
        min-width: 0;
        padding: 0 10px;
    }

    .hero__metrics dt {
        line-height: 1.35;
        white-space: normal;
    }

    .hero__metrics dd {
        font-size: 21px;
        white-space: nowrap;
    }

    .search-panel-wrap {
        position: relative;
        inset: auto;
        margin-top: 30px;
    }

    .search-panel {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        border-radius: 16px;
    }

    .search-field,
    .search-field--keyword,
    .search-submit {
        grid-column: auto;
        width: 100%;
    }

    .search-field input,
    .search-field select {
        width: 100%;
    }

    .trust-strip {
        padding-top: 22px;
    }

    .trust-strip__inner {
        gap: 8px;
    }

    .section,
    .services,
    .building-section,
    .process-section,
    .consulting-cta,
    .site-footer {
        overflow: hidden;
    }

    .section-heading,
    .section-heading--compact {
        gap: 14px;
    }

    .section-heading h2,
    .process-copy h2 {
        max-width: 100%;
        font-size: clamp(29px, 9vw, 35px);
        overflow-wrap: anywhere;
    }

    .service-card,
    .building-card,
    .consulting-cta__inner {
        width: 100%;
        min-width: 0;
    }

    .service-card {
        min-height: 270px;
        padding-bottom: 78px;
    }

    .building-city-tabs {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .building-card h3,
    .building-card__summary,
    .building-card__address,
    .building-card__station strong,
    .site-footer__top > p {
        overflow-wrap: anywhere;
    }

    .process-list li {
        min-width: 0;
    }

    .process-list li > div {
        min-width: 0;
    }

    .consulting-cta__inner {
        gap: 22px;
        padding: 30px 22px;
    }

    .site-footer nav {
        gap: 12px 16px;
    }

    .mobile-bottom-cta {
        width: 100%;
        max-width: 100%;
    }

    /* 공개 상세 */
    body.has-mobile-cta {
        overflow-x: clip;
    }

    .v2-site-header {
        overflow: hidden;
    }

    .v2-site-header__inner {
        min-height: 58px;
    }

    .v2-brand {
        gap: 9px;
    }

    .v2-brand__mark {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border-radius: 11px;
    }

    .v2-header-nav {
        margin-left: auto;
    }

    .v2-header-nav a:last-child {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .v2-hero {
        min-height: clamp(520px, 76svh, 680px);
    }

    .v2-hero__inner {
        padding-top: 68px;
        padding-bottom: 34px;
    }

    .v2-hero__content {
        width: 100%;
        min-width: 0;
    }

    .v2-hero h1 {
        max-width: 100%;
        font-size: clamp(34px, 10.6vw, 48px);
        line-height: 1.1;
        letter-spacing: -.045em;
        overflow-wrap: anywhere;
    }

    .v2-hero__subtitle {
        max-width: 100%;
        font-size: 15px;
        line-height: 1.6;
    }

    .v2-hero__meta {
        gap: 6px;
    }

    .v2-pill {
        max-width: 100%;
        min-height: 34px;
        padding: 6px 10px;
        font-size: 11px;
        line-height: 1.4;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .v2-hero__actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .v2-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .v2-stat-card {
        min-width: 0;
        min-height: 98px;
        padding: 14px;
    }

    .v2-stat-card__value,
    .v2-stat-card__sub {
        overflow-wrap: anywhere;
    }

    .v2-section,
    .v2-visual-overview {
        overflow: hidden;
        padding-top: 52px;
        padding-bottom: 52px;
    }

    .v2-section-head {
        margin-bottom: 24px;
    }

    .v2-section h2,
    .v2-cta-panel h2 {
        max-width: 100%;
        font-size: clamp(28px, 8.5vw, 34px);
        overflow-wrap: anywhere;
    }

    .v2-section-head p,
    .v2-rich-content,
    .v2-guide-card,
    .v2-guide-card li {
        overflow-wrap: anywhere;
    }

    .v2-visual-overview__layout,
    .v2-guide-grid,
    .v2-related-grid {
        min-width: 0;
        gap: 12px;
    }

    .v2-aerial-panel,
    .v2-registry-panel,
    .v2-guide-card,
    .v2-floor-panel,
    .v2-address-card,
    .v2-cta-panel,
    .v2-related-card {
        max-width: 100%;
        border-radius: 14px;
    }

    .v2-aerial-slide,
    .v2-aerial-slide img {
        min-height: 300px;
    }

    .v2-aerial-slide__caption {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .v2-registry-table-wrap {
        max-width: 100%;
        overflow-x: hidden;
    }

    .v2-registry-table {
        table-layout: auto;
    }

    .v2-registry-table th {
        width: 35%;
        min-width: 92px;
    }

    .v2-registry-table th,
    .v2-registry-table td {
        padding: 10px 11px;
        overflow-wrap: anywhere;
    }

    .v2-feature-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .v2-feature-list li {
        width: 100%;
        min-width: 0;
        min-height: 0;
        flex-basis: auto;
        padding: 16px 16px 16px 42px;
    }

    .v2-feature-list li::before {
        top: 17px;
        left: 15px;
    }

    .v2-guide-card {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .v2-guide-card__index {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .v2-card-carousel,
    .v2-gallery {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .v2-card-carousel__track {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        grid-auto-columns: minmax(0, 88%);
        padding: 2px 0 14px;
        overscroll-behavior-inline: contain;
    }

    .v2-gallery {
        margin-right: 0;
        padding-right: 0;
        overscroll-behavior-inline: contain;
    }

    .v2-gallery__item,
    .v2-gallery__item:first-child {
        flex-basis: 88%;
        max-width: 88%;
    }

    .v2-scene-card,
    .v2-floor-tabs,
    .v2-floor-panel,
    .v2-floor-panel button,
    .v2-floor-panel img {
        max-width: 100%;
    }

    .v2-floor-tabs {
        overscroll-behavior-inline: contain;
    }

    .v2-floor-panel__caption {
        gap: 6px;
    }

    .v2-address-card,
    .v2-cta-panel {
        gap: 18px;
        padding: 22px;
    }

    .v2-address-card address,
    .v2-coordinates,
    .v2-related-card__body,
    .v2-related-card__body p {
        overflow-wrap: anywhere;
    }

    .v2-lightbox {
        width: calc(100% - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 16px;
    }

    .v2-mobile-cta {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 8px;
        min-height: 54px;
        border-radius: 14px;
    }

    /* 모바일 지도 토글 */
    .v2-mobile-map-toggle {
        display: flex;
        width: 100%;
        min-height: 52px;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 15px;
        border: 1px solid #dbe2ea;
        border-radius: 14px;
        background: #fff;
        color: var(--navy);
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }

    .v2-mobile-map-toggle__label {
        display: grid;
        gap: 2px;
    }

    .v2-mobile-map-toggle__label small {
        color: #8a95a5;
        font-size: 9px;
        font-weight: 600;
        letter-spacing: .08em;
    }

    .v2-mobile-map-toggle__label strong {
        font-size: 14px;
        font-weight: 750;
    }

    .v2-mobile-map-toggle__icon {
        position: relative;
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        border-radius: 50%;
        background: #eef3f8;
    }

    .v2-mobile-map-toggle__icon::before,
    .v2-mobile-map-toggle__icon::after {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 10px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        content: "";
        transform: translate(-50%, -50%);
    }

    .v2-mobile-map-toggle__icon::after {
        transform: translate(-50%, -50%) rotate(90deg);
        transition: transform .18s ease;
    }

    .v2-mobile-map-toggle[aria-expanded="true"] .v2-mobile-map-toggle__icon::after {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    .v2-kakao-location {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .v2-kakao-location.is-map-collapsed > .v2-kakao-location__card {
        display: none;
    }

    .v2-kakao-location.is-map-collapsed .v2-kakao-location__direction {
        display: none !important;
    }

    .v2-kakao-location__card,
    .v2-public-transport {
        width: 100%;
        max-width: 100%;
    }

    .v2-kakao-location__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .v2-kakao-location__head-actions {
        width: 100%;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .v2-kakao-location__links {
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .v2-kakao-location__canvas {
        height: min(78vw, 320px);
    }

    .v2-public-transport {
        padding: 16px 12px;
        border-radius: 14px;
    }

    .v2-public-transport__head {
        display: block;
    }

    .v2-public-transport__head p {
        max-width: none;
        margin-top: 6px;
        text-align: left;
    }

    .v2-public-transport__grid {
        grid-template-columns: 1fr;
    }

    .v2-public-transport__item-main {
        gap: 10px;
    }

    .v2-public-transport__item-main strong,
    .v2-public-transport__item-main small {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 430px) {
    :root {
        --public-mobile-gutter: 12px;
    }

    .hero h1,
    .v2-hero h1 {
        font-size: clamp(32px, 10.5vw, 43px);
    }

    .hero__metrics div {
        padding-inline: 7px;
    }

    .hero__metrics dd {
        font-size: 19px;
    }

    .hero__metrics dd span {
        margin-left: 2px;
        font-size: 10px;
    }

    .search-panel {
        padding: 10px;
    }

    .service-card {
        padding-right: 20px;
        padding-left: 20px;
    }

    .v2-stat-card {
        padding: 12px;
    }

    .v2-stat-card__value {
        font-size: 18px;
    }

    .v2-registry-table th {
        min-width: 84px;
    }

    .v2-guide-card {
        grid-template-columns: 36px minmax(0, 1fr);
        padding: 14px;
    }

    .v2-guide-card__index {
        width: 36px;
        height: 36px;
    }

    .v2-card-carousel__track {
        grid-auto-columns: minmax(0, 92%);
    }

    .v2-gallery__item,
    .v2-gallery__item:first-child {
        flex-basis: 92%;
        max-width: 92%;
    }

    .v2-kakao-location__head-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .v2-kakao-location__canvas {
        height: min(82vw, 300px);
    }
}
