:root {
    --hm-green: #7AB648;
    --hm-yellow: #F5D000;
    --hm-blue: #00A3D9;
    --hm-dark: #2D2D2D;
    --hm-light-bg: #F7F9FC;
    --hm-radius: 12px;
    --hm-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

.hm-addr-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--hm-dark);
    max-width: 1100px;
    margin: 0 auto;
}

.hm-addr-toolbar {
    background: var(--hm-light-bg);
    border-radius: var(--hm-radius);
    padding: 18px 20px;
    margin-bottom: 24px;
    box-shadow: var(--hm-shadow);
}

.hm-addr-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.hm-addr-title {
    margin: 0;
    font-size: 1.4rem;
    color: var(--hm-dark);
}

.hm-addr-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hm-addr-count {
    font-size: 0.95rem;
    color: var(--hm-dark);
    opacity: 0.75;
}

.hm-addr-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--hm-blue);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.hm-addr-print-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 163, 217, 0.35);
}
.hm-addr-print-btn:active { transform: translateY(0); }

.hm-addr-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 18px;
}
@media (max-width: 720px) {
    .hm-addr-filters { grid-template-columns: 1fr; }
}

.hm-addr-filter-group {
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0;
}
.hm-addr-filter-group legend {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hm-dark);
    padding: 0 6px;
}

.hm-addr-filter-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.hm-addr-link-btn {
    background: none;
    border: none;
    color: var(--hm-blue);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    text-decoration: underline;
}
.hm-addr-link-btn:hover { color: #0086b3; }

.hm-addr-cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}
.hm-addr-cat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--hm-light-bg);
    border: 1px solid #e3e7ee;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}
.hm-addr-cat-item:hover { background: #eef2f7; }
.hm-addr-cat-item input { margin: 0; cursor: pointer; }
.hm-addr-cat-count {
    background: var(--hm-blue);
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
}

.hm-addr-toggle {
    display: inline-flex;
    background: var(--hm-light-bg);
    border: 1px solid #e3e7ee;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.hm-addr-toggle button {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--hm-dark);
    transition: background 0.15s, color 0.15s;
}
.hm-addr-toggle button.is-active {
    background: var(--hm-green);
    color: #fff;
    font-weight: 600;
}

.hm-addr-print-header {
    display: none;
}

.hm-addr-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.hm-addr-group {
    break-inside: avoid;
    page-break-inside: avoid;
}

.hm-addr-group-title {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    color: #fff;
    background: var(--hm-blue);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

.hm-addr-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hm-addr-item {
    padding: 8px 0;
    border-bottom: 1px solid #eef0f4;
    break-inside: avoid;
    page-break-inside: avoid;
}
.hm-addr-item:last-child { border-bottom: none; }

.hm-addr-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.hm-addr-street {
    font-weight: 600;
    font-size: 1rem;
}

.hm-addr-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hm-addr-badge--nest {
    background: var(--hm-yellow);
    color: var(--hm-dark);
}
.hm-addr-badge--hub {
    background: var(--hm-green);
    color: #fff;
}

.hm-addr-cats {
    font-size: 0.85rem;
    color: #555;
    margin-top: 2px;
}

.hm-addr-empty,
.hm-addr-empty-inline {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 16px;
}

/* ===== Print Layout ===== */
@media print {
    .hm-no-print { display: none !important; }

    body { background: #fff !important; }

    .hm-addr-wrapper {
        max-width: none;
        margin: 0;
        font-size: 10pt;
        color: #000;
    }

    .hm-addr-print-header {
        display: block;
        margin-bottom: 16px;
        border-bottom: 2px solid var(--hm-green);
        padding-bottom: 8px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .hm-addr-print-header h1 {
        margin: 0;
        font-size: 16pt;
        color: var(--hm-dark);
    }
    .hm-addr-print-date {
        margin: 2px 0 0;
        font-size: 9pt;
        color: #555;
    }

    .hm-addr-list {
        column-count: 2;
        column-gap: 18px;
        display: block;
    }

    .hm-addr-group {
        margin-bottom: 14px;
    }

    .hm-addr-group-title {
        background: var(--hm-blue) !important;
        color: #fff !important;
        font-size: 11pt;
        padding: 3px 8px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .hm-addr-item {
        padding: 4px 0;
        border-bottom: 1px solid #ddd;
    }

    .hm-addr-street {
        font-size: 10pt;
    }

    .hm-addr-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 7pt;
        padding: 1px 5px;
    }
    .hm-addr-badge--nest {
        background: var(--hm-yellow) !important;
        color: var(--hm-dark) !important;
    }
    .hm-addr-badge--hub {
        background: var(--hm-green) !important;
        color: #fff !important;
    }

    .hm-addr-cats {
        font-size: 8.5pt;
        color: #333;
    }

    @page {
        margin: 1.5cm 1.2cm;
    }
}
