html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a1a;
    color: #1a1a1a;
}

#map {
    position: absolute;
    inset: 0;
}

/* Floating search bar — pill-shaped, near the top */
#search-bar {
    position: absolute;
    top: max(env(safe-area-inset-top, 0px) + 12px, 12px);
    left: 24px;
    right: 24px;
    height: 48px;
    background: #ffffff;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 10;
    cursor: text;
    overflow: hidden;
}

#search-bar .icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #1976d2; /* primary blue */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#search-bar .icon-right {
    color: #5f6368; /* on-surface-variant grey */
    transition: transform 400ms ease, opacity 400ms ease;
}

#search-bar .icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    position: absolute;
    inset: 0;
    transition: opacity 400ms ease;
}

/* Left icon: crossfade between place (idle) and search (searching) */
#search-bar.idle .icon-left .svg-search { opacity: 0; }
#search-bar.idle .icon-left .svg-place { opacity: 1; }
#search-bar.searching .icon-left .svg-place { opacity: 0; }
#search-bar.searching .icon-left {
    color: #5f6368;
}
#search-bar.searching .icon-left .svg-search { opacity: 1; }

/* Right icon: slides leftward and fades out when searching */
#search-bar.searching .icon-right {
    transform: translateX(-96px);
    opacity: 0;
    pointer-events: none;
}

.search-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    min-width: 0;
}

#search-greeting {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
}

#search-input {
    width: 100%;
    height: 24px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #1a1a1a;
    display: none;
}

#search-bar.searching #search-greeting { display: none; }
#search-bar.searching #search-input { display: block; }

#search-results {
    position: absolute;
    top: calc(max(env(safe-area-inset-top, 0px) + 12px, 12px) + 56px);
    left: 24px;
    right: 24px;
    max-height: 320px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}

.result-row {
    padding: 14px 20px;
    font-size: 16px;
    color: #1a1a1a;
    cursor: pointer;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.result-row:last-child { border-bottom: none; }
.result-row:hover { background: #f5f5f5; }
