* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.container {
    width: min(1100px, 92%);
    margin: 40px auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.top-bar {
    margin-bottom: 14px;
}

.search-box input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    outline: none;
}

.area-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: thin;
}

.area-pill {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.area-pill:hover {
    background: #eef2ff;
    border-color: #2563eb;
}

.area-pill.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.saved-section {
    margin-bottom: 18px;
    position: relative;
}

.saved-toggle {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.saved-toggle span {
    display: inline-block;
    margin-left: 8px;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
}

.saved-dropdown {
    margin-top: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.saved-list {
    display: flex;
    flex-direction: column;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}

.saved-item:last-child {
    border-bottom: none;
}

.saved-item-info {
    min-width: 0;
}

.saved-item-number {
    font-weight: 600;
    word-break: break-word;
}

.saved-item-area {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.saved-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.saved-map-btn,
.saved-remove-btn,
.map-btn {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    padding: 9px 12px;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.saved-map-btn,
.map-btn {
    background: #2563eb;
    color: #fff;
}

.saved-remove-btn {
    background: #dc2626;
    color: #fff;
}

.table-wrap {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: fixed;
}

thead {
    background: #111827;
    color: #fff;
}

th,
td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

th:nth-child(1),
td:nth-child(1) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

th:nth-child(2),
td:nth-child(2) {
    width: auto;
}

th:nth-child(3),
td:nth-child(3) {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
}

th:nth-child(4),
td:nth-child(4) {
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
}

th:nth-child(2),
td:nth-child(2) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

tbody tr:hover {
    background: #f9fafb;
}

.save-col {
    text-align: center;
}

.save-btn {
    border: none;
    background: transparent;
    box-shadow: none;
    color: #cbd5e1;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    min-width: 0;
    width: auto;
    height: auto;
    transition: transform 0.15s ease, color 0.2s ease;
}

.save-btn:hover {
    transform: scale(1.08);
    color: #f59e0b;
}

.save-btn.saved {
    color: #f59e0b;
}

.map-btn {
    display: inline-block;
    padding: 10px 14px;
    font-size: 14px;
}

.no-results,
.saved-empty {
    padding: 18px 16px;
    text-align: center;
    color: #6b7280;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        width: 94%;
        margin: 24px auto;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .search-box input {
        font-size: 15px;
        padding: 12px 14px;
    }

    table {
        min-width: 700px;
    }

    th,
    td {
        padding: 12px;
        font-size: 14px;
    }

    th:nth-child(1),
    td:nth-child(1) {
        width: 56px;
        min-width: 56px;
        max-width: 56px;
    }

    th:nth-child(3),
    td:nth-child(3) {
        width: 100px;
        min-width: 100px;
    }

    th:nth-child(4),
    td:nth-child(4) {
        width: 120px;
        min-width: 120px;
    }

    .map-btn,
    .saved-map-btn,
    .saved-remove-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .save-btn {
        font-size: 24px;
    }

    .saved-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .saved-item-actions {
        width: 100%;
    }
}