 * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
            display: flex;
            flex-direction: column;
            height: 100dvh;
            background: #f5f5f4;
            color: #1c1917;
        }

        header {
            background: #1c1917;
            color: #fff;
            padding: 0 1.25rem;
            height: 52px;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-shrink: 0;
            z-index: 1000;
        }

        header .logo {
            font-size: 1.1rem;
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        header .badge {
            font-size: 0.7rem;
            background: #e7000b;
            color: #fff;
            padding: 2px 7px;
            border-radius: 99px;
            font-weight: 600;
        }

        .layout {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* ---- Sidebar ---- */
        .sidebar {
            width: 300px;
            flex-shrink: 0;
            background: #fff;
            border-right: 1px solid #e7e5e4;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }

        .sidebar-inner {
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .instruction {
            background: #f5f5f4;
            border-radius: 8px;
            padding: 0.875rem;
            font-size: 0.8rem;
            line-height: 1.6;
            color: #57534e;
        }

        .instruction strong {
            color: #1c1917;
            display: block;
            margin-bottom: 0.25rem;
            font-size: 0.85rem;
        }

        /* Result card */
        .result-card {
            border-radius: 10px;
            border: 1.5px solid #e7e5e4;
            overflow: hidden;
            transition: border-color 0.2s;
        }

        .result-card.did {
            border-color: #e7000b;
        }

        .result-card.not-did {
            border-color: #16a34a;
        }

        .result-header {
            padding: 0.875rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.625rem;
            background: #f5f5f4;
        }

        .result-card.did .result-header {
            background: #fff1f2;
        }

        .result-card.not-did .result-header {
            background: #f0fdf4;
        }

        .result-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            flex-shrink: 0;
            background: #e7e5e4;
        }

        .result-card.did .result-icon {
            background: #e7000b;
            color: #fff;
        }

        .result-card.not-did .result-icon {
            background: #16a34a;
            color: #fff;
        }

        .result-label {
            font-size: 0.95rem;
            font-weight: 700;
        }

        .result-card.did .result-label {
            color: #e7000b;
        }

        .result-card.not-did .result-label {
            color: #16a34a;
        }

        .result-body {
            padding: 0.875rem 1rem;
        }

        .result-message {
            font-size: 0.8rem;
            line-height: 1.6;
            color: #57534e;
        }

        .result-coords {
            margin-top: 0.75rem;
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .coord-row {
            display: flex;
            justify-content: space-between;
            font-size: 0.78rem;
        }

        .coord-label {
            color: #a8a29e;
        }

        .coord-value {
            font-family: 'SF Mono', 'Fira Code', monospace;
            color: #1c1917;
            font-weight: 500;
        }

        /* Loading spinner */
        .loading {
            display: none;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.82rem;
            color: #a8a29e;
            padding: 0.5rem 0;
        }

        .spinner {
            width: 16px;
            height: 16px;
            border: 2px solid #e7e5e4;
            border-top-color: #a8a29e;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* Map */
        .map-wrap {
            flex: 1;
            position: relative;
        }

        #map {
            width: 100%;
            height: 100%;
            cursor: crosshair;
        }

        .map-hint {
            position: absolute;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(28, 25, 23, 0.75);
            color: #fff;
            font-size: 0.78rem;
            padding: 0.4rem 0.9rem;
            border-radius: 99px;
            pointer-events: none;
            z-index: 500;
            white-space: nowrap;
            backdrop-filter: blur(4px);
            transition: opacity 0.3s;
        }

        .map-hint.hidden {
            opacity: 0;
        }

        /* Marker popup */
        .did-popup {
            font-size: 0.82rem;
        }

        .did-popup .tag {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 700;
            font-size: 0.78rem;
            margin-bottom: 4px;
        }

        .did-popup .tag.red {
            background: #fff1f2;
            color: #e7000b;
        }

        .did-popup .tag.green {
            background: #f0fdf4;
            color: #16a34a;
        }

        /* Address search */
        .search-box {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .search-label {
            font-size: 0.78rem;
            font-weight: 600;
            color: #57534e;
        }

        .search-row {
            display: flex;
            gap: 0.5rem;
        }

        .search-input {
            flex: 1;
            border: 1.5px solid #e7e5e4;
            border-radius: 8px;
            padding: 0.5rem 0.75rem;
            font-size: 0.85rem;
            font-family: inherit;
            color: #1c1917;
            outline: none;
            transition: border-color 0.15s;
            background: #fff;
        }

        .search-input:focus {
            border-color: #a8a29e;
        }

        .search-input::placeholder {
            color: #c4b5ab;
        }

        .search-btn {
            background: #1c1917;
            color: #fff;
            border: none;
            border-radius: 8px;
            padding: 0.5rem 0.875rem;
            font-size: 0.82rem;
            font-family: inherit;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s;
            white-space: nowrap;
        }

        .search-btn:hover {
            background: #292524;
        }

        .search-btn:disabled {
            background: #d6d3d1;
            cursor: default;
        }

        .search-candidates {
            display: none;
            flex-direction: column;
            gap: 2px;
            margin-top: 2px;
        }

        .search-candidate {
            padding: 0.45rem 0.75rem;
            border-radius: 6px;
            font-size: 0.78rem;
            color: #44403c;
            cursor: pointer;
            border: 1px solid #e7e5e4;
            background: #fff;
            transition: background 0.1s;
            line-height: 1.4;
        }

        .search-candidate:hover {
            background: #f5f5f4;
        }

        .search-error {
            display: none;
            font-size: 0.78rem;
            color: #e7000b;
            padding: 0.25rem 0;
        }

        /* Legend */
        .legend {
            background: #fff;
            border-radius: 8px;
            padding: 0.75rem;
            border: 1px solid #e7e5e4;
            font-size: 0.78rem;
        }

        .legend-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: #57534e;
            font-size: 0.78rem;
        }

        .legend-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.3rem;
            color: #78716c;
        }

        .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        @media (max-width: 640px) {
            .layout {
                flex-direction: column-reverse;
            }

            .sidebar {
                width: 100%;
                height: 220px;
                border-right: none;
                border-top: 1px solid #e7e5e4;
            }
        }