.hgf-wayfinding {
    --hgf-blue: #174d87;
    --hgf-green: #07874d;
    box-sizing: border-box;
    width: 100%;
    max-width: 1100px;
    margin: 24px auto;
    overflow: hidden;
    border: 1px solid #dbe4ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 35px rgb(26 55 75 / 12%);
    color: #173244;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hgf-wayfinding * { box-sizing: border-box; }
.hgf-wayfinding__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    color: #fff;
    background: linear-gradient(120deg, var(--hgf-blue), var(--hgf-green));
}
.hgf-wayfinding__header h2 { margin: 0 0 4px; color: inherit; font-size: clamp(20px, 3vw, 30px); }
.hgf-wayfinding__header p { margin: 0; opacity: .9; }
.hgf-wayfinding__legend { white-space: nowrap; font-size: 13px; }
.hgf-wayfinding__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.hgf-wayfinding__canvas { position: relative; overflow: hidden; background: #eef4f6; }
.hgf-wayfinding__viewport {
    position: relative;
    overflow: hidden;
    transform-origin: center;
    transition: transform .2s ease;
}
.hgf-wayfinding__viewport > img { display: block; width: 100%; height: auto; user-select: none; }
.hgf-wayfinding__map-tools {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgb(255 255 255 / 94%);
}
.hgf-wayfinding__map-tools button,
.hgf-wayfinding__map-tools select {
    min-height: 30px;
    border: 1px solid #1767a4;
    border-radius: 6px;
    background: #fff;
    color: #174d87;
    font-weight: 700;
}
.hgf-wayfinding__map-tools button { min-width: 34px; cursor: pointer; }
.hgf-wayfinding__map-tools label { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.hgf-wayfinding__map-tools strong {
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef6fb;
    color: #174d87;
    font-size: 12px;
}
.hgf-wayfinding.is-floor-map [data-floor-filter],
.hgf-wayfinding.is-floor-map .hgf-wayfinding__route-layer,
.hgf-wayfinding.is-floor-map .hgf-wayfinding__network-nodes,
.hgf-wayfinding.is-floor-map .hgf-wayfinding__hotspot {
    display: none;
}
.hgf-wayfinding.is-floor-map .hgf-wayfinding__viewport > img {
    object-fit: contain;
    background: #fff;
}
.hgf-wayfinding__route-layer {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.hgf-wayfinding__route-layer polyline {
    fill: none;
    stroke: #00cfe8;
    stroke-width: 1.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 1px rgb(0 37 71 / 75%));
    vector-effect: non-scaling-stroke;
}
.hgf-wayfinding__route-layer marker path { fill: #00cfe8; }
.hgf-wayfinding__route-layer [data-network-edges] line {
    stroke: rgb(24 90 150 / 58%);
    stroke-width: 1.2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.hgf-wayfinding__route-layer [data-network-edges] line.is-accessible {
    stroke: rgb(20 132 71 / 72%);
}
.hgf-wayfinding__route-layer [data-route-line] {
    fill: none;
    stroke: #ffcb2f;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.hgf-wayfinding__route-layer [data-step-line] {
    fill: none;
    stroke: #e33d32;
    stroke-width: 4;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.hgf-wayfinding__network-nodes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hgf-wayfinding__network-node {
    position: absolute;
    z-index: 3;
    left: var(--x);
    top: var(--y);
    translate: -50% -50%;
    border: 0;
    background: transparent;
    color: #183746;
    cursor: pointer;
    pointer-events: auto;
}
.hgf-wayfinding__network-node i {
    display: block;
    width: 14px;
    height: 14px;
    margin: auto;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1767a4;
    box-shadow: 0 1px 5px rgb(0 0 0 / 40%);
}
.hgf-wayfinding__network-node span {
    display: none;
    width: max-content;
    max-width: 150px;
    margin-top: 2px;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 1px 4px rgb(0 0 0 / 18%);
    font-size: 10px;
    font-weight: 600;
}
.hgf-wayfinding__network-node:hover span,
.hgf-wayfinding__network-node:focus span,
.hgf-wayfinding__network-node.is-selected span {
    display: block;
}
.hgf-wayfinding__network-node.is-selected i {
    background: #d63638;
    outline: 4px solid rgb(214 54 56 / 24%);
}
.hgf-wayfinding__network-node.is-origin i {
    background: #ffcb2f;
    outline: 4px solid rgb(255 203 47 / 32%);
}
.hgf-wayfinding__network-node.is-origin span { display: block; }
.hgf-wayfinding__network-node.has-panorama i {
    width: 20px;
    height: 20px;
    border-color: #fff;
    background: #0b7d4f;
    outline: 4px solid rgb(11 125 79 / 25%);
}
.hgf-wayfinding__network-node.has-panorama b {
    position: absolute;
    left: 50%;
    top: -17px;
    translate: -50% 0;
    padding: 1px 4px;
    border-radius: 4px;
    background: #0b7d4f;
    color: #fff;
    font-size: 9px;
    line-height: 1.4;
    white-space: nowrap;
}
.hgf-wayfinding__hotspot {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: clamp(30px, 4vw, 44px);
    height: clamp(30px, 4vw, 44px);
    padding: 0;
    transform: translate(-50%, -50%);
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--hgf-green);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 3px 12px rgb(0 0 0 / 35%);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}
.hgf-wayfinding__hotspot { z-index: 2; }
.hgf-wayfinding__hotspot:hover,
.hgf-wayfinding__hotspot:focus-visible,
.hgf-wayfinding__hotspot.is-selected { z-index: 2; transform: translate(-50%, -50%) scale(1.18); background: #e86b20; }
.hgf-wayfinding__form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    padding: 20px 24px;
    background: #f7fafb;
}
.hgf-wayfinding__form label { display: grid; gap: 6px; font-weight: 650; }
.hgf-wayfinding__form input[type="search"] { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #b8cbd6; border-radius: 8px; background: #fff; }
.hgf-wayfinding__accessible { display: flex !important; grid-auto-flow: column; align-items: center; max-width: 190px; font-size: 13px; font-weight: 500 !important; }
.hgf-wayfinding__form button { min-height: 42px; padding: 8px 18px; border: 0; border-radius: 8px; background: var(--hgf-green); color: #fff; font-weight: 750; cursor: pointer; }
.hgf-wayfinding__location-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hgf-wayfinding__location-actions button {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--hgf-blue);
    background: #fff;
    color: var(--hgf-blue);
    font-size: 11px;
}
.hgf-wayfinding__location-actions button.is-active {
    background: var(--hgf-blue);
    color: #fff;
}
.hgf-wayfinding__location-actions button:disabled {
    cursor: not-allowed;
    opacity: .55;
}
.hgf-wayfinding__form small { color: #526b78; font-weight: 500; }
.hgf-wayfinding__arrow { padding-bottom: 10px; font-size: 24px; color: var(--hgf-blue); }
.hgf-wayfinding__result { margin: 0 24px 24px; padding: 16px 18px; border-left: 4px solid var(--hgf-green); border-radius: 8px; background: #effaf4; }
.hgf-wayfinding__result h3 { margin: 0 0 8px; font-size: 18px; }
.hgf-wayfinding__result ol { margin: 8px 0 0 20px; }
.hgf-wayfinding__result.is-error { border-color: #c63333; background: #fff1f1; color: #8c2020; }
.hgf-wayfinding__steps {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin: 12px 24px;
    padding: 10px;
    border: 1px solid #c8dae4;
    border-radius: 8px;
    background: #fff;
}
.hgf-wayfinding__steps[hidden] { display: none; }
.hgf-wayfinding__steps button {
    min-height: 34px;
    border: 1px solid var(--hgf-blue);
    border-radius: 7px;
    background: #fff;
    color: var(--hgf-blue);
    font-weight: 700;
    cursor: pointer;
}
.hgf-wayfinding__steps button:disabled { cursor: not-allowed; opacity: .45; }
.hgf-wayfinding__steps span { text-align: center; font-size: 13px; }

@media (max-width: 760px) {
    .hgf-wayfinding__header { align-items: flex-start; flex-direction: column; }
    .hgf-wayfinding__form { grid-template-columns: 1fr; }
    .hgf-wayfinding__arrow { display: none; }
    .hgf-wayfinding__accessible { max-width: none; }
    .hgf-wayfinding__steps { grid-template-columns: 1fr 1fr; }
    .hgf-wayfinding__steps span { grid-column: 1 / -1; grid-row: 1; }
}
