#hp-entity-search-root,
#hp-entity-search-root * {
    box-sizing: border-box;
}

dialog.hp-modal-dialog.hp-es-dialog,
.hp-es-dock {
    font-family: Montserrat, sans-serif;
}

.hp-app-main {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#app.hp-es-dock-left,
#app.hp-es-dock-right,
#app.hp-es-dock-top,
#app.hp-es-dock-bottom {
    display: flex;
    align-items: stretch;
}

#app.hp-es-dock-left,
#app.hp-es-dock-right {
    flex-direction: row !important;
}

#app.hp-es-dock-top,
#app.hp-es-dock-bottom {
    flex-direction: column;
}

#app.hp-es-dock-right > #hp-entity-search-slot,
#app.hp-es-dock-bottom > #hp-entity-search-slot {
    order: 2;
}

#app.hp-es-dock-left > #hp-entity-search-slot,
#app.hp-es-dock-right > #hp-entity-search-slot,
#app.hp-es-dock-top > #hp-entity-search-slot,
#app.hp-es-dock-bottom > #hp-entity-search-slot {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
}

#app.hp-es-dock-left > #hp-entity-search-slot,
#app.hp-es-dock-right > #hp-entity-search-slot {
    display: flex;
    flex-direction: column;
    width: min(340px, 92vw);
}

#app.hp-es-dock-left #hp-entity-search-root,
#app.hp-es-dock-right #hp-entity-search-root,
#app.hp-es-dock-left .hp-es-mount,
#app.hp-es-dock-right .hp-es-mount {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.hp-es-dock {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    background: var(--hp-modal-bg, #ffffff);
    color: var(--hp-modal-text-color, #1e293b);
    border: 0px solid #334155;
    box-shadow: var(--hp-modal-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.45));
    overflow: hidden;
}

.hp-es-dock--left,
.hp-es-dock--right {
    width: 100%;
    flex: 1 1 auto;
    height: 100%;
    max-height: none;
    min-height: 0;
    margin-left: 3px;
}

.hp-es-dock--top,
.hp-es-dock--bottom {
    width: 100%;
    height: auto;
    max-height: 46vh;
}

.hp-modal-header .hp-es-pins {
    display: flex;
    gap: 4px;
    margin: 0 auto;
    flex: 0 0 auto;
}

.hp-modal-header .hp-es-pin {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
}

.hp-modal-header .hp-es-pin.is-on {
    background: #ffffff;
    color: #0f172a;
}

.hp-modal-header .hp-es-pin:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.hp-modal-header .hp-es-pin.is-on:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.hp-es-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 0 0;
}

.hp-es-search-row .hp-es-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.hp-es-search-row .hp-es-switch {
    flex: 0 0 auto;
}

.hp-es-input {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    color: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #fff;
}

.hp-es-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 7px;
    /* margin: 12px 0; */
}

.hp-es-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    user-select: none;
}

.hp-es-switch input {
    appearance: none;
    width: 36px;
    height: 20px;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: #64748b;
    cursor: pointer;
    position: relative;
    flex: 0 0 auto;
}

.hp-es-switch input:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.hp-es-switch input:checked {
    background: #0369a1;
}

.hp-es-switch input:checked:before {
    transform: translateX(16px);
}

.hp-es-switch input:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.hp-es-switch-ui {
    display: none;
}

.hp-es-switch:has(input:checked) {
    color: #0f172a;
}

.hp-es-status {
    font-size: 13px;
    color: #334155;
    margin: 4px 0 8px;
}

.hp-es-dialog .hp-modal-body,
.hp-es-dock .hp-modal-body {
    overflow: hidden;
}

.hp-es-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* padding: 0 4px 0 0; */
}

.hp-es-results > .hp-es-hit + .hp-es-hit {
    margin-top: 4px;
    margin: 4px 4px 0 0;
}

.hp-es-hit.hp-modal-card {
    flex: 0 0 auto;
    padding: 0;
    overflow: hidden;
    margin: 4px 4px 0 0;
}

.hp-es-hit--on-card {
    box-shadow: inset 3px 0 0 #d97706;
}

.hp-es-hit--on-card .hp-es-name,
.hp-es-mark {
    background: #fbbf24;
    color: #0f172a;
    border-radius: 2px;
    padding: 0 3px;
}

.hp-es-hit-head {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    border: 0;
    background: var(--hp-modal-card-bg, #ffffff);
    padding: 6px 6px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: #0f172a;
}

.hp-es-results > .hp-es-hit:only-child {
    overflow: visible;
}

.hp-es-results > .hp-es-hit:only-child .hp-es-hit-head {
    position: sticky;
    top: 0;
    z-index: 2;
}

.hp-es-name {
    font-weight: 600;
    min-width: 0;
}

.hp-es-type {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    padding: 1px 4px;
    border-radius: 4px;
    width: 69px;
    text-align: center;
}

.hp-es-type--horse {background: #4d66aa;}
.hp-es-type--jockey {background: #aa4d4d;}
.hp-es-type--trainer {background: #83aa4d;}

.hp-es-races {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px 12px;
}

.hp-es-race-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #334155;
    margin-bottom: 4px;
}

.hp-es-past,
.hp-es-current {
    /* max-height: 220px; */
    overflow-y: auto;
}

.hp-es-past-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.hp-es-past-select {
    flex: 1 1 0;
    min-width: 0;
    height: 28px;
    padding: 0 4px;
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    border: 1px solid #334155;
    border-radius: 4px;
}

.hp-es-date {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    border: 0;
    border-top: 1px solid #e2e8f0;
    background: transparent;
    padding: 7px 2px;
    cursor: pointer;
    text-align: left;
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    font-variant: tabular-nums;
}

.hp-es-date:hover {
    color: #0369a1;
}

.hp-es-runs {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
}

.hp-es-date-races {
    padding: 0 0 4px 16px;
}

.hp-es-race {
    display: block;
    width: 100%;
    border: 0;
    border-top: 1px solid #e2e8f0;
    background: transparent;
    padding: 6px 2px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: #0f172a;
    font-variant: tabular-nums;
    letter-spacing: -0.5px;
}

.hp-es-race:hover {
    color: #0369a1;
}

.hp-es-launch {
    align-self: center;
    border: 0;
    background: transparent;
    padding: 0 6px;
    cursor: pointer;
    color: #0f172a;
    line-height: 1;
    font-size: 18px;
}

.hp-es-launch:hover {
    color: #0369a1;
}
