:root{
    --navy:#0c3158;
    --blue:#1769aa;
    --orange:#ef8a32;
    --green:#168a45;
    --text:#24313d;
    --muted:#687684;
    --border:#d9e3eb;
    --bg:#f4f7fa;
    --white:#fff;
    --shadow:0 16px 42px rgba(12,49,88,.10);
}

*{box-sizing:border-box;}

html{scroll-behavior:smooth;}

body{
    margin:0;
    color:var(--text);
    background:
        radial-gradient(circle at top left, rgba(23,105,170,.09), transparent 30%),
        var(--bg);
    font-family:"Yu Gothic","YuGothic","Hiragino Kaku Gothic ProN","Meiryo",sans-serif;
}

button,input,a{font:inherit;}

button,a{
    -webkit-tap-highlight-color:transparent;
}

.page-header{
    color:#fff;
    background:linear-gradient(135deg,var(--navy),var(--blue));
}

.header-inner{
    max-width:1240px;
    margin:auto;
    padding:26px 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.eyebrow{
    margin:0 0 6px;
    font-size:12px;
    font-weight:800;
    letter-spacing:.16em;
    opacity:.82;
}

h1{
    margin:0;
    font-size:clamp(28px,4vw,44px);
}

.back-link{
    color:#fff;
    text-decoration:none;
    padding:10px 16px;
    border:1px solid rgba(255,255,255,.45);
    border-radius:999px;
}

.map-page{
    max-width:1240px;
    margin:auto;
    padding:28px 24px 70px;
}

.toolbar-card,
.map-card,
.notice-card{
    background:rgba(255,255,255,.96);
    border:1px solid var(--border);
    border-radius:18px;
    box-shadow:var(--shadow);
}

.toolbar-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:24px;
    align-items:end;
    padding:22px;
    margin-bottom:22px;
}

.search-area label{
    display:block;
    margin-bottom:9px;
    color:var(--navy);
    font-weight:800;
}

.search-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    gap:8px;
}

.search-row input{
    min-width:0;
    padding:13px 14px;
    border:1px solid #bfcbd5;
    border-radius:10px;
    outline:none;
}

.search-row input:focus{
    border-color:var(--blue);
    box-shadow:0 0 0 3px rgba(23,105,170,.13);
}

button{
    cursor:pointer;
    border:0;
    border-radius:10px;
    padding:12px 17px;
    color:#fff;
    background:var(--blue);
    font-weight:800;
}

button:hover{filter:brightness(.96);}

.button-secondary{
    color:var(--navy);
    background:#e8eef3;
}

.search-message{
    min-height:1.5em;
    margin:9px 0 0;
    color:var(--muted);
    font-size:13px;
}

.pdf-button{
    min-width:245px;
    display:flex;
    align-items:center;
    gap:13px;
    padding:14px 17px;
    color:#fff;
    text-decoration:none;
    background:linear-gradient(135deg,#c83232,#a51f1f);
    border-radius:13px;
    box-shadow:0 10px 24px rgba(165,31,31,.20);
    transition:transform .2s ease,box-shadow .2s ease;
}

.pdf-button:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 28px rgba(165,31,31,.28);
}

.pdf-icon{
    display:grid;
    place-items:center;
    width:48px;
    height:48px;
    flex:0 0 48px;
    color:#b42020;
    background:#fff;
    border-radius:9px;
    font-size:12px;
    font-weight:900;
}

.pdf-button strong,
.pdf-button small{display:block;}

.pdf-button small{
    margin-top:3px;
    opacity:.84;
}

.map-card{overflow:hidden;}

.map-card-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:20px 22px;
    border-bottom:1px solid var(--border);
}

.map-card-header h2,
.notice-card h2{
    margin:0;
    color:var(--navy);
}

.map-card-header p{
    margin:6px 0 0;
    color:var(--muted);
    font-size:13px;
}

.zoom-controls{
    display:flex;
    gap:7px;
}

.zoom-controls button{
    min-width:45px;
    color:var(--navy);
    background:#eaf0f5;
}

.map-viewport{
    position:relative;
    width:100%;
    height:min(72vh,760px);
    min-height:430px;
    overflow:hidden;
    touch-action:none;
    background:
        linear-gradient(45deg,#f4f6f8 25%,transparent 25%),
        linear-gradient(-45deg,#f4f6f8 25%,transparent 25%),
        linear-gradient(45deg,transparent 75%,#f4f6f8 75%),
        linear-gradient(-45deg,transparent 75%,#f4f6f8 75%),
        #fff;
    background-size:24px 24px;
    background-position:0 0,0 12px,12px -12px,-12px 0;
    cursor:grab;
}

.map-viewport.dragging{cursor:grabbing;}

.map-stage{
    position:absolute;
    inset:0;
    transform-origin:0 0;
    will-change:transform;
}

#floorMapObject{
    display:block;
    width:100%;
    height:100%;
    border:0;
    pointer-events:none;
}

.map-help{
    display:flex;
    flex-wrap:wrap;
    gap:12px 24px;
    padding:12px 20px;
    color:var(--muted);
    background:#f7f9fb;
    border-top:1px solid var(--border);
    font-size:12px;
}

.notice-card{
    margin-top:22px;
    padding:20px 22px;
}

.notice-card p{
    margin:10px 0 0;
    line-height:1.8;
}

code{
    padding:2px 6px;
    background:#eef2f5;
    border-radius:5px;
}

.page-footer{
    padding:28px 20px;
    color:#fff;
    background:var(--navy);
    text-align:center;
    font-weight:800;
    letter-spacing:.12em;
}

.svg-search-hit{
    filter:drop-shadow(0 0 8px #ff7a00);
    opacity:1 !important;
}

@media(max-width:800px){
    .toolbar-card{
        grid-template-columns:1fr;
    }

    .pdf-button{min-width:0;}

    .map-card-header{
        align-items:flex-start;
        flex-direction:column;
    }

    .map-viewport{
        height:62vh;
        min-height:360px;
    }
}

@media(max-width:560px){
    .header-inner{
        align-items:flex-start;
        padding:20px 16px;
    }

    .back-link{
        padding:8px 11px;
        font-size:12px;
    }

    .map-page{padding:18px 12px 50px;}

    .toolbar-card{padding:16px;}

    .search-row{
        grid-template-columns:1fr 1fr;
    }

    .search-row input{
        grid-column:1 / -1;
    }

    .zoom-controls{
        width:100%;
    }

    .zoom-controls button{flex:1;}
}

@media(prefers-reduced-motion:reduce){
    *{scroll-behavior:auto!important;transition:none!important;}
}
