/* ── Postal Index Pages: search widget + tables ─────────────────────────── */

.index-search {
    position: relative;
    max-width: 640px;
    margin: 24px 0 32px;
}

/* Search icon via CSS background on the input */
.index-search input {
    width: 100%;
    padding: 18px 20px 18px 52px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-sizing: border-box;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 16px center;
    color: #111;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: border-color .18s, box-shadow .18s;
    line-height: 1.4;
}
.index-search input:focus {
    outline: none;
    border-color: #0a7d33;
    box-shadow: 0 2px 16px rgba(10,125,51,.15);
}
.index-search input::placeholder { color: #aaa; }

.index-search__results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
    max-height: 340px;
    overflow: auto;
    z-index: 20;
    display: none;
}
.index-search__results div {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
    cursor: default;
    font-size: 15px;
}
.index-search__results div:last-child { border-bottom: none; }
.index-search__results div:hover { background: #f7fdf9; }
.index-search__results b  { color: #0a7d33; }
.index-search__results .idx {
    float: right;
    font-weight: 700;
    color: #0a7d33;
    background: #e8f5ee;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 13px;
    margin-left: 8px;
}

/* Tables */
.index-table-wrap {
    max-height: 640px;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 24px;
}
#streetTable, #revTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
#streetTable th, #streetTable td,
#revTable  th, #revTable  td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}
#streetTable thead th {
    position: sticky;
    top: 0;
    background: #f7f7f7;
    z-index: 2;
}
#revTable thead th { background: #f7f7f7; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .index-search input {
        background-color: #1e1e1e;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
        border-color: #444;
        color: #eee;
    }
    .index-search input:focus { border-color: #2daa5f; box-shadow: 0 2px 16px rgba(45,170,95,.18); }
    .index-search__results { background: #1e1e1e; border-color: #444; }
    .index-search__results div { border-bottom-color: #2a2a2a; }
    .index-search__results div:hover { background: #1a2e20; }
    .index-search__results .idx { background: #1a2e20; color: #2daa5f; }
    .index-table-wrap { border-color: #333; }
    #streetTable th, #streetTable td,
    #revTable  th, #revTable  td { border-bottom-color: #333; }
    #streetTable thead th,
    #revTable   thead th { background: #2a2a2a; color: #ddd; }
}
