html,
body {
    margin: 0;
    height: 100%;
    background: var(--pak);
    overscroll-behavior: none;

}

* {
    font-family: AkzidenzGrotesk, ui-sans-serif, system-ui, sans-serif;
    box-sizing: border-box;
}

.picked * {
    fill: var(--pak) !important;
    fill-opacity: 0.8 !important;
    stroke: blue !important;
    stroke-width: 1px !important;
}

#app {
    --bg: hsl(250 30% 8%);
    --panel: hsl(250 25% 14%);
    --line: hsl(250 20% 26%);
    --txt: hsl(250 15% 88%);
    --muted: hsl(250 12% 60%);
    --purple: hsl(265 60% 65%);
    --amber: hsl(40 90% 60%);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: black;
    height: 100%;
    display: flex;
    flex-direction: row;
    min-height: 0;
}

.bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px 10px 0 0;
    font-size: 13px;
}

.btn {
    background: hsl(265 40% 22%);
    color: var(--txt);
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    transition: background .12s;
}

.btn:hover {
    background: hsl(265 45% 30%);
}

.btn:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.readout {
    color: var(--muted);
}

.readout b {
    color: var(--amber);
    font-weight: 600;
}

#frame {
    background: white;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    flex: 1;
}

#logoWrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-content: center;
    border-radius: 16px;
    width: 100%;
}

#logo {
    width: 100%;
    height: auto;
    max-width: 190px;
}

/* touch-action:none is load-bearing: it tells the browser "hands off, the app handles all touch" */
#stage {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

#stage.grabbing {
    cursor: grabbing;
}

.hint {
    color: var(--muted);
    font-size: 12px;
    margin: 10px 12px;
}

.hint b {
    color: var(--purple);
}


#sidebar {
    background: var(--pak);
    padding: 18px 1rem;
    font-size: 13px;
    color: black;
    width: 320px;
    max-width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 12px;
    align-items: center;
}

.sidebar-brand .store-name {
    color: black;
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-brand .theme-toggle {
    margin-left: 0;
    align-self: center;
    background: rgba(255, 255, 255, 0.72);
    color: black;
    border-color: rgba(0, 0, 0, 0.12);
}

.mobile-actions {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.mobile-mode-button {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 12px 14px;
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.mobile-mode-button--primary {
    background: black;
    color: white;
}

.mobile-mode-button--secondary {
    color: #111;
}

#searchWrapper {
    margin-bottom: 2px;
}

#searchForm {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

#search {
    flex: 1;
    padding: 8px 12px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: white;
    color: black;
    font-size: 13px;
}


#searchButton {
    background: white;
    color: black;
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    transition: background .12s;
}

#inspect {
    margin-top: 10px;
    font-size: 13px;
    gap: 20px;
    max-height: calc(100vh - 170px);
    padding-right: 2px;
    overflow-y: auto;
    flex-direction: column;

}

.inspect-summary {
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: black;
    margin-bottom: 8px;
}

.inspect-empty {
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed rgba(0, 0, 0, 0.16);
    border-radius: 14px;
    padding: 14px 16px;
    color: rgba(0, 0, 0, 0.72);
}

.product-card {
    margin-top: 2px;
    appearance: none;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 14px;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
}

.product-card:hover {
    border-color: rgba(0, 0, 0, 0.2);
}


.product-card.active {
    border-color: green;
}

.product-card-badge {
    align-self: flex-start;
    background: #111;
    color: white;
    border-radius: 999px;
    padding: 5px 10px;
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-card-title {
    color: #111;
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
}

.product-card-meta {
    color: rgba(0, 0, 0, 0.66);
    font-size: 0.86rem;
    line-height: 1.35;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.product-card-location {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--pak);
    color: #111;
    font-family: SaveySans, AkzidenzGrotesk, system-ui, sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.product-card-footer-text {
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.74rem;
    text-align: right;
}

@media (max-width: 900px) {
    #app {
        flex-direction: column;
        height: 100%;
        min-height: 100%;
    }

    #sidebar {
        width: 100%;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        padding: 14px;
        flex: 0 0 auto;
    }

    #logoWrapper {
        padding: 14px 16px;
        max-width: 70%;
        margin: 0 auto;
    }

    .mobile-actions {
        display: flex;
    }

    #searchForm {
        flex-direction: column;
        align-items: stretch;
    }

    #search {
        width: 100%;
        box-sizing: border-box;
    }

    #searchButton {
        width: 100%;
    }

    #inspect {
        max-height: 100%;

    }

    #app[data-mobile-mode="search"] #frame {
        display: none;
    }

    #app[data-mobile-mode="search"] #searchWrapper,
    #app[data-mobile-mode="search"] #inspect {
        display: flex;
    }

    #app[data-mobile-mode="browse"] #frame,
    #app[data-mobile-mode="selected"] #frame {
        display: block;
    }

    #app[data-mobile-mode="selected"] #searchWrapper,
    #app[data-mobile-mode="selected"] #inspect {
        display: none;
    }

    #app[data-mobile-mode="selected"] #stage {
        pointer-events: none;
    }

    #app[data-mobile-mode="search"] .mobile-mode-button--secondary,
    #app[data-mobile-mode="browse"] .mobile-mode-button--primary,
    #app[data-mobile-mode="selected"] .mobile-mode-button--primary {
        display: none;
    }

    #app[data-mobile-mode="selected"] #sidebar,
    #app[data-mobile-mode="browse"] #sidebar {
        height: auto;
    }

    #app[data-mobile-mode="browse"] #searchWrapper {
        display: none;
    }

    .product-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-card-footer-text {
        text-align: left;
    }

    #frame {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        min-height: 60vh;
    }
}