body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #111;
    color: #fff;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

#map {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

#ui-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: min(90vw, 420px);
}

.panel {
    background: rgba(17, 17, 17, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: opacity 0.2s ease;
}

.hidden {
    display: none !important;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.search-box input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    outline: none;
}

.search-box input:focus {
    border-color: #00ffcc;
    box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
}

.search-box button {
    background: #00ffcc;
    color: #000;
    border: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

button,
.search-box button,
.route-select-btn,
.status-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

button svg,
.status-text svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    stroke-width: 2;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 10px;
    max-height: 280px;
    overflow: auto;
    padding-right: 4px;
}

.search-result-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.search-result-item:hover {
    background: rgba(0, 255, 204, 0.06);
    border-color: rgba(0, 255, 204, 0.38);
}

.search-result-item .title {
    display: block;
    font-size: 0.92rem;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 600;
}

.search-result-item .meta {
    display: block;
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.4;
}

.search-result-item.no-result {
    cursor: default;
    border-style: dashed;
    color: #ddd;
    background: rgba(255, 170, 0, 0.03);
}

.location-status {
    margin: 8px 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: left;
    border: 1px solid transparent;
}

.location-status.info {
    background: rgba(0, 255, 204, 0.08);
    border-color: rgba(0, 255, 204, 0.2);
    color: #bafaf0;
}

.location-status.warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.22);
    color: #ffd58a;
}

.location-status.error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.28);
    color: #ffb3b3;
}

.location-status.success {
    background: rgba(82, 255, 144, 0.08);
    border-color: rgba(82, 255, 144, 0.22);
    color: #b8f7c8;
}

.hint-text {
    font-size: 0.75rem;
    color: #aaa;
    text-align: left;
    padding-left: 5px;
}

.info-text {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #ddd;
}

.status-text {
    font-size: 0.95rem;
    color: #ffaa00;
    margin-bottom: 12px;
    font-weight: bold;
}

.btn-group {
    display: flex;
    gap: 10px;
}

button {
    background: #00ffcc;
    color: #000;
    border: none;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

button.secondary {
    background: #333;
    color: #fff;
    border: 1px solid #555;
}

button.danger {
    background: #ff4444;
    color: #fff;
    border: none;
}

.route-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.route-item {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    text-align: left;
}

.route-item.selected {
    background: rgba(0, 255, 204, 0.1);
    border-color: rgba(0, 255, 204, 0.7);
}

.route-item-title {
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.route-item-desc {
    font-size: 0.85rem;
    color: #aaa;
}

.route-select-btn {
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    #ui-container {
        top: auto;
        bottom: max(16px, env(safe-area-inset-bottom));
        width: min(100% - 24px, 480px);
    }

    .panel {
        padding: 12px;
        border-radius: 10px;
    }

    .search-box {
        gap: 6px;
    }

    .search-box input,
    .search-box button,
    button {
        min-height: 44px;
    }

    .btn-group {
        flex-direction: column;
        gap: 8px;
    }

    .search-results {
        max-height: min(34vh, 240px);
    }
}

@media (min-width: 601px) {
    .panel {
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}