.hbp-front {
    color: #1f2937;
    font-family: inherit;
    line-height: 1.55;
}

.hbp-front *,
.hbp-front *::before,
.hbp-front *::after {
    box-sizing: border-box;
}

.hbp-header {
    margin: 0 0 20px;
}

.hbp-header h2,
.hbp-detail h2 {
    color: inherit;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    line-height: 1.2;
    margin: 0 0 8px;
}

.hbp-header p {
    color: #4b5563;
    margin: 0;
}

.hbp-search {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 20px 0;
    padding: 14px;
}

.hbp-search label span {
    color: #374151;
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.hbp-search input,
.hbp-search select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    min-height: 42px;
    padding: 8px 10px;
    width: 100%;
}

.hbp-search button,
.hbp-button {
    align-items: center;
    background: var(--hbp-primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    text-decoration: none;
}

.hbp-button:hover,
.hbp-search button:hover {
    color: #fff;
    filter: brightness(0.94);
}

.hbp-button-secondary {
    background: #0f172a;
}

.hbp-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.hbp-view-switch a {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    color: #374151;
    padding: 7px 12px;
    text-decoration: none;
}

.hbp-view-switch a.is-active {
    background: var(--hbp-primary);
    border-color: var(--hbp-primary);
    color: #fff;
}

.hbp-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hbp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hbp-card-image {
    aspect-ratio: 16 / 10;
    background: #eef2f7;
    display: block;
    overflow: hidden;
}

.hbp-image {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hbp-placeholder {
    align-items: center;
    color: #64748b;
    display: flex;
    justify-content: center;
    min-height: 180px;
}

.hbp-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}

.hbp-card-title-row,
.hbp-detail-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.hbp-card h3,
.hbp-list h3 {
    font-size: 1.15rem;
    line-height: 1.25;
    margin: 0;
}

.hbp-card p,
.hbp-list p,
.hbp-detail p {
    margin: 0;
}

.hbp-meta,
.hbp-status-detail,
.hbp-search-summary {
    color: #64748b;
    font-size: 0.95rem;
}

.hbp-status {
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 6px 10px;
}

.hbp-state-free {
    background: color-mix(in srgb, var(--hbp-free) 14%, white);
    color: var(--hbp-free);
}

.hbp-state-occupied {
    background: color-mix(in srgb, var(--hbp-occupied) 14%, white);
    color: var(--hbp-occupied);
}

.hbp-state-reserved {
    background: color-mix(in srgb, var(--hbp-reserved) 16%, white);
    color: var(--hbp-reserved);
}

.hbp-state-maintenance {
    background: color-mix(in srgb, var(--hbp-maintenance) 14%, white);
    color: var(--hbp-maintenance);
}

.hbp-state-blocked,
.hbp-state-unavailable {
    background: color-mix(in srgb, var(--hbp-blocked) 14%, white);
    color: var(--hbp-blocked);
}

.hbp-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hbp-amenities span {
    background: #f1f5f9;
    border-radius: 999px;
    color: #334155;
    font-size: 0.85rem;
    padding: 5px 9px;
}

.hbp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.hbp-message {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}

.hbp-list {
    display: grid;
    gap: 10px;
}

.hbp-list-row {
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: 86px 1fr auto auto;
    padding: 10px;
}

.hbp-list-row img,
.hbp-list-row .hbp-placeholder {
    border-radius: 6px;
    height: 64px;
    min-height: 64px;
    width: 86px;
}

.hbp-calendar-wrap {
    overflow-x: auto;
}

.hbp-calendar {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

.hbp-calendar th,
.hbp-calendar td {
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
    padding: 8px;
    text-align: center;
    white-space: nowrap;
}

.hbp-calendar th:first-child {
    text-align: left;
}

.hbp-cal-free {
    background: color-mix(in srgb, var(--hbp-free) 12%, white);
    color: var(--hbp-free);
}

.hbp-cal-occupied {
    background: color-mix(in srgb, var(--hbp-occupied) 14%, white);
    color: var(--hbp-occupied);
}

.hbp-cal-reserved {
    background: color-mix(in srgb, var(--hbp-reserved) 15%, white);
    color: var(--hbp-reserved);
}

.hbp-cal-maintenance,
.hbp-cal-blocked,
.hbp-cal-unavailable {
    background: #e2e8f0;
    color: #334155;
}

.hbp-month-calendar {
    display: grid;
    gap: 12px;
    position: relative;
}

.hbp-month-calendar.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.hbp-month-header {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 42px 1fr 42px;
}

.hbp-month-header h3 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 0;
    text-align: center;
}

.hbp-month-nav {
    align-items: center;
    background: var(--hbp-primary);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-size: 1.6rem;
    font-weight: 700;
    height: 42px;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    width: 42px;
}

.hbp-month-nav:hover {
    color: #fff;
    filter: brightness(0.94);
}

.hbp-month-weekdays,
.hbp-month-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hbp-month-weekdays span {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.hbp-month-day {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    min-height: 138px;
    padding: 8px;
}

.hbp-month-day-empty {
    background: #f8fafc;
    border-style: dashed;
    opacity: 0.55;
}

.hbp-month-day.is-today {
    border-color: var(--hbp-primary);
    box-shadow: inset 0 0 0 1px var(--hbp-primary);
}

.hbp-month-date {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
}

.hbp-month-houses {
    display: grid;
    gap: 4px;
}

.hbp-month-house {
    align-items: center;
    background: #f8fafc;
    border-radius: 6px;
    display: grid;
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) 8px auto;
    min-height: 26px;
    padding: 4px 6px;
}

.hbp-month-house-name,
.hbp-month-status {
    font-size: 0.78rem;
    line-height: 1.2;
    min-width: 0;
}

.hbp-month-house-name {
    color: #1f2937;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbp-month-status {
    color: #475569;
    text-align: right;
}

.hbp-month-dot {
    border-radius: 999px;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.hbp-month-state-free .hbp-month-dot {
    background: var(--hbp-free);
}

.hbp-month-state-occupied .hbp-month-dot {
    background: var(--hbp-occupied);
}

.hbp-month-state-reserved .hbp-month-dot {
    background: var(--hbp-reserved);
}

.hbp-month-state-maintenance .hbp-month-dot {
    background: var(--hbp-maintenance);
}

.hbp-month-state-blocked .hbp-month-dot,
.hbp-month-state-unavailable .hbp-month-dot {
    background: var(--hbp-blocked);
}

.hbp-month-state-free {
    background: color-mix(in srgb, var(--hbp-free) 9%, white);
}

.hbp-month-state-occupied {
    background: color-mix(in srgb, var(--hbp-occupied) 10%, white);
}

.hbp-month-state-reserved {
    background: color-mix(in srgb, var(--hbp-reserved) 11%, white);
}

.hbp-month-state-maintenance,
.hbp-month-state-blocked,
.hbp-month-state-unavailable {
    background: #e2e8f0;
}

.hbp-detail {
    display: grid;
    gap: 20px;
}

.hbp-detail-media {
    display: grid;
    gap: 10px;
}

.hbp-detail-media > .hbp-image {
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
}

.hbp-gallery {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}

.hbp-gallery a {
    aspect-ratio: 1;
    background: #eef2f7;
    border-radius: 6px;
    display: block;
    overflow: hidden;
}

.hbp-gallery img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hbp-detail-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.hbp-detail-section h3 {
    font-size: 1.05rem;
    margin: 0 0 8px;
}

.hbp-copyright {
    border-top: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 24px;
    padding-top: 14px;
    text-align: center;
}

.hbp-front-dark {
    background: #111827;
    color: #e5e7eb;
    padding: 18px;
}

.hbp-front-dark .hbp-header p,
.hbp-front-dark .hbp-meta,
.hbp-front-dark .hbp-status-detail,
.hbp-front-dark .hbp-search-summary {
    color: #cbd5e1;
}

.hbp-front-dark .hbp-search,
.hbp-front-dark .hbp-card,
.hbp-front-dark .hbp-list-row,
.hbp-front-dark .hbp-message {
    background: #1f2937;
    border-color: #374151;
}

.hbp-front-dark .hbp-amenities span {
    background: #334155;
    color: #e5e7eb;
}

.hbp-front-dark .hbp-copyright {
    border-color: #374151;
    color: #cbd5e1;
}

.hbp-front-dark .hbp-month-day,
.hbp-front-dark .hbp-month-house {
    background: #1f2937;
    border-color: #374151;
}

.hbp-front-dark .hbp-month-day-empty {
    background: #111827;
}

.hbp-front-dark .hbp-month-date,
.hbp-front-dark .hbp-month-house-name {
    color: #e5e7eb;
}

.hbp-front-dark .hbp-month-weekdays span,
.hbp-front-dark .hbp-month-status {
    color: #cbd5e1;
}

@media (max-width: 760px) {
    .hbp-search {
        grid-template-columns: 1fr;
    }

    .hbp-card-title-row,
    .hbp-detail-header {
        display: grid;
    }

    .hbp-list-row {
        grid-template-columns: 70px 1fr;
    }

    .hbp-list-row .hbp-status,
    .hbp-list-row .hbp-button {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .hbp-month-weekdays,
    .hbp-month-grid {
        gap: 3px;
    }

    .hbp-month-day {
        border-radius: 6px;
        min-height: 104px;
        padding: 4px;
    }

    .hbp-month-house {
        gap: 3px;
        grid-template-columns: minmax(0, 1fr);
        padding: 4px;
    }

    .hbp-month-dot {
        display: none;
    }

    .hbp-month-status {
        font-size: 0.68rem;
        text-align: left;
    }

    .hbp-month-house-name {
        font-size: 0.68rem;
    }
}
